Changes

An Overview of Digital Circuit Simulation

24 bytes removed, 13:00, 22 October 2015
/* How Does the Digital Simulation Engine Work? */
[[File:b2MAN_Fig37.png|thumb|400px| A simple digital inverter circuit.]]
Rather than giving a theoretical account of the workings of the [[Digital Simulation|digital simulation]] engine, here we present an example. The circuit used for this example will be the simple inverter function given below.
Assuming that the initial conditions are set to indeterminate level and strength, all wires and pins will be preset to the indeterminate state with unknown strengths. As soon as the simulation starts, however, the input port will send a message to the simulation engine that its pin's value should be 0, causing the program's wire change list to be appended with the first wire's ID (0). The program will then process the wire changes. That is, the value of wire 0 is calculated to be 0, and the wire's value is passed to each of the pins that connected to it. Since the input to the inverter was previously unknown, and its new value is a strong 0, the input pin will be appended to the device input change list.
All of this happens at time t = 0. Wire 0 now has a value of zero, and both the output pin of the input port and the input pin of the inverter have values of 0. Assuming that the simulator is running, the next step is to advance the time to the point of the next state change. From the future change list, we see that the next change is at the time t = 8ns, so time is forwarded to 8ns. Now, the future change is realized, i.e., the output pin of the inverter changes value to a strong 1, and the wire connected to it, wire 1, is put on the wire change list. Then the wire change list is processed. First, the wire's value is calculated. Since the output pin is a strong 1 and the input to the output port is still unknown, the wire's value is calculated to be a strong 1. The devices that are connected to wire 1 are put on the device input change list, and the connected pins' values are set to strong 1. Finally, the output probe's state is recalculated. Since the output probe's input pin is a strong 1, the output probe displays 1.
This example is very simple, yet it illustrates the workings of the digital circuit simulation engine. Note that the simulator doesn't have to continually check for signal changes at every nanosecond, but rather it keeps track of future events which in turn drive the simulator. Reset Time, Go, Step, and changing an input value all update the circuit state if necessary once you have changed the circuit.
==Setting Up Digital Circuit Simulations==
28,333
edits