26-09-2013, 03:46 PM
To verify the characteristics of Basic Digital Gates
INTRODUCTION
You're simulating a circuit, it requires several digital gates, but you don't have a mixed-mode
simulator. What to do? One solution involves creating simplified versions of the logic functions.
To do this, we look to the NMOS transistor implementation of logic gates where the transistor
acts like a voltage-controlled switch. But, instead of the transistor, we'll use the SPICE switch.
Just like the transistor, the switch is defined to turn ON when the input voltage goes HI.
THE NAND GATE
So let's have a go at simulating the NAND gate. How do you describe its function? When both A
and B are HI, the output is LO. Or stated another way - it's the AND function with an inverted
output. The Boolean expression looks like
OTHER GATES
You can test drive some of the other gates defined in SPICE file. Place an asterisk * in front of
the NAND statement and call one of the other gates. Simulating the XNOR gate, for example,
would like this.
ADDING GATE DELAY
You could run into trouble when running a transient analysis on devices with fast transitions.
SPICE algorithms may fail under these conditions. This is especially true with complex circuits
having feedforward or feedback paths. ( Like RS flip-flops created from NAND gates.) The
solution is to sprinkle a little RC delay on the devices slowing the transitions enough to where
SPICE successfully computes the simulation.