Lab5 - Logic Gates Simulation Using LTSpice
Lab5 - Logic Gates Simulation Using LTSpice
I. Objectives
II. Materials
a. PC/Desktop
b. LTSpice Software
III. Concepts
LTSpice has a few “behavior logic gates” it is nice to have a collection of the basic gates with the
standard number of inputs and ports for power supply (some systems use 5V, some use 3V3, some use
other source references).
IV. Procedures
Even though LTSpice has a large collection of components in the library, sometimes it is better to
define components using specific parameters. The MOSFETs used in my forum post above use specific
values to ensure proper behavior. The program has two models that allow custom parameters:
MOSFET Parameters
Change “yourModelName” to something else unique, I used NMOD1 and PMOD1 respectively. Place
the spice directive somewhere on your diagram. Press the “S” key again and add this for the
PMOSFET:
To edit the length and width of each MOSFET channel, right-click the MOSFET in question. The P-
MOSFETs share the same values:
Again, change “yourModelName” to the one you typed in the spice commands. Mine would have
been PMOD1 for the P-MOSFETs and NMOD1 for the N-MOSFETs.
The N-MOSFETs have slightly different lengths and widths. The top one (NMODA in my diagram) has
these values:
Make sure to use the same model name as both SPICE commands otherwise the program doesn’t
know what parameters to use.
Output SPICE Directive for Simulation
One other SPICE command is added: CL Out 0 1p. This is a shortcut to tell LTSpice that you want some
kind of capacitance and inductance on the output. Out refers to the output, 0 is the amount of
inductance present and 1p is the amount of capacitance present (backward from the letters). This is
done sometimes to help the program simulate a little quicker.
You can make all the other gates using just NAND gates or a combination of NOT and NAND gates.
AND
OR
NOR
XOR
XNOR
V. Exercises