Simulation of Digital
Circuits using PSpice
Contents
Although one of the more compact forms of examining a digital
circuit's behavior is via a truth table, PSpice displays the result
of simulating a digital circuit by displaying a timing diagram.
While this is not as compact as a truth table, it does give one
the ability to see the exact relationship between signals and
to see potential glitches. The following outline briefly lists
some of the issues and processes necessary to have PSpice do a
simulation on a digital circuit.
- Describe circuit as a schematic using
Schematics
- Add test signal sources via stimulus generators
- Available from source library
- Specify operation of generator via commands
- Double-click symbol to get Part parameters window
- Fill in values (see example window below)
- TIMESTEP--length of one clock cycle (may be left blank if
all changes are listed at specific times)
- COMMANDs--specify times for values or actions in various formats
- <<time><value>>
- REPEAT FOREVER
- REPEAT <n> TIMES
- ENDREPEAT
- <LABEL=<label name>>
- <<time>GOTO<label name><n>TIMES>
- <<time>GOTO<label name>UNTIL GT | GE | LT |
LE <value>>
- <<time>INCR | DECR BY <value>>
- <time> in seconds (default) or clock cycles
(use "c" suffix). May be absolute
(default such as 25m or 7c) or relative to the
previous time (done by prefix of "+"
such as +3n or +4c)
- <value> can be 0, 1, R (Rising), F (Falling),
X (unknown), or Z (Hi-impedance)
- <n> is number of times to repeat a loop or GOTO. Use
-1 to specify "forever"
- Usually do not display VALUE or NAME (via Change Display
button) to avoid clutter on schematic
- Label signal names you are interested in using Label command
under Edit Menu
- To see voltage levels instead of logic levels:
- Add dropping resistors to inputs of gates
- Add load resistor to outputs of gates
- Start process via Analysis Menu item from the Schematics
Window (shown below)
- First select Setup... under Analysis Menu (gives window
shown below)
- Enable Transient analysis (put X in Enabled box)
- Select Transient... button (gives window shown below)
- Print Step: When values should be reported to the simulation
output file. Note that this value does not affect the internal
step time that PSpice uses during the analysis, rather PSpice
continuously adjusts its internal step time to maintain
accuracy while not performing unnecessary steps.
- Final Time: Total time the analysis is to span. Choose a
value to allow all possible logic states to be seen
- Digital Setup used to set flip-flop initial states
(example window shown below)
- Then select Simulate under Analysis Menu
- Errors--shown in PSpice output; need to understand PSpice
syntax to interpret meaning
- No Errors--Probe window opens automatically
- Probe
- Select Trace Add... from Menu bar
- Pick signals you wish on your timing diagram
- Then click OK to get a display like the following
- Use View from the Menu bar to select the portion of
the trace to be displayed
Beginning of Simulation Information
PSpice Information Index