Skip to content

Simulate logic gates on a compiled single-instruction VM with Rust

Notifications You must be signed in to change notification settings

Vandesm14/complogic

Repository files navigation

Complogic

Tests

Simulate logic gates on a compiled single-instruction VM with Rust.

Why?

I wanted to build a system to work with a known-system rather than interpreting the circuit graph each tick, even if it was lazy. With Complogic, all gates are compiled into a set of Nand instructions, which execute at runtime.

What?

With this design decision comes the power to ignore propagation entirely and set everything all at once. There isn't any "run until things settle" logic, and the system is entirely deterministic.

How?

The VM only cares about outputs. Inputs are immediates, provided when running the simulation. Any gate that needs an input, can either use the output of another gate, or the immediates. This allows everything to be packed within the register stack of the VM, only storing the necessary values.

Credits

About

Simulate logic gates on a compiled single-instruction VM with Rust

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages