|
|
|
|
|
by compumike
2199 days ago
|
|
(Disclosure: I wrote the simulation engine behind CircuitLab, a mixed-mode [i.e. analog+digital combined] circuit simulation engine.) Writing software to do digital logic simulation is quite simple. Everything is event-driven: if a signal "A" changes from 0->1 at time t_0, and this signal is an input to some gate "X", then at time t_0 + t_p (propagation delay) the output of that gate will update with the new value, as defined by that particular gate/register/whatever. So events can originate from (1) external signals (such as buttons/switches), (2) clocks, (3) the output of an earlier gate updating its output after a propagation delay. You can then just propagate changes throughout the digital circuit, looking at what's connected to the signal that just changed state. It gets a bit more tricky once you combine analog and digital simulations simultaneously. :) |
|