Uxxxxxxx out gnd vdd enable in1 in2 ... family gatetype
Logic element for mixed or logic mode simulation.
A sample 2 input nand gate might be: U102 5 0 34 34 2 3 cmos nand. The input pins are connected to nodes 2 and 3. The output is at node 5. Node 34 is the power supply.
The logic element behaves differently depending on the options analog, mixed, or digital. You set one of these with the options command. Analog mode substitutes a subcircuit for the gate for full analog simulation. Digital mode simulates the gate as a digital device as in an event driven gate level logic simulator. Mixed mode applies heuristics to decide whether to use analog or digital for each gate.
In analog mode the logic (U) device is almost the same as a subcircuit (X). The subcircuit is user defined for each gate type used. A .subckt defines the analog equivalent of a logic element. The name of the subcircuit is made by concatenating the family, gatetype, and the number of inputs. For example, if the family is cmos and the gatetype is nand and it has two inputs, the name of the subcircuit is cmosnand2. So, the gate in the first paragraph becomes equivalent to: X 5 0 34 34 2 3 cmosnand2. You then need to define the subcircuit using the standard .subckt notation. You can probe the internal elements the same as an ordinary subcircuit.
The digital mode uses simple boolean expressions to compute the output, just like a gate level logic simulator. In this case the output is computed by L(5) = not(L(2) and L(3)) where L(2) is the logic state at node 2. The simulator exploits latency so it will only compute the output if one of the inputs changes. The output actually changes after a delay, specified in the .model statement. There are no conversions between digital and analog where gates connect together. There will be an automatic conversion from analog to digital for any input that is driven by an analog device. There will be an automatic conversion from digital to analog for any output that drives an analog device. These conversions will only be done if they are needed. You can probe the analog value at any node. The probe will automatically request the conversion if it needs it. There is no internal subcircuit so it is an error to probe the internal elements.
The mixed mode is a combination of analog and digital modes on a gate by gate basis. Some gates will be analog. Some will be digital. This will change as the simulation runs based on the quality of the signals. You need to specify a .subckt as you do for the analog mode, but the simulator may not use it. You can usually not probe the elements inside the subcircuit because they come and go.
Family refers to the logic family .model statement.
Gatetype is the type of logic gate:
In this release, there are no probes available in AC analysis except for the internal elements. Internal elements in the analog model are available, but they come and go so they may be unreliable. More parameters will be added.
You can probe the logic value at any node. See the print command for details.