SPICE stands for Simulation Program Integrated Circuits Especially! The program originates from the University of California, Berkeley. Spice is used to provide a reasonably detailed analysis of circuits containing active components such as bipolar transistors, field effect transistors, diodes and lumped components such as resistors, capacitors and inductors. Note that Spice is a circuit simulation program, not a logic simulation program. Thus Spice considers the voltages and currents in a circuit to be continuous quantities, not quantised into high/low values. The original Spice program has given rise to a variety of commercial implementations. At Aberdeen the following versions are available to you:
Spice reads in a sequential text file containing a description of the circuit to be simulated, and a set of commands specifying the required simulation and output data. The input file consists of cards which are either:
The circuit to be simulated is best drawn on paper, and each node numbered (note that many CAD tools can automatically generate a Spice circuit description from a computer held circuit schematic - this can be done with Aberdeen University Engineering Department's CAD Software). By convention the node connected to ground, or the datum node, is numbered 0, Spice requires this convention to be followed. Each element of the circuit should then be named, noting that the first letter of the name determines the type of element, thus R denotes a resistance, C a capacitor. Names should not contain the characters ' ' (space), '=', ',' (comma), '(' or ')'.
Following the name the node connections are given, and then the parameters specific to the circuit element. Thus for a 1pF capacitor named CLoad:
Cload 10 0 1PF
giving a capacitor connected from node 10 to ground (node 0).
For the more complex elements, bipolar transistors, field effect transistors and diodes, many of the parameters will be the same for each element. For example, with a circuit using MOSFETS parameters such as tox will be identical for each element, since tox is determined by the process line, not by the circuit designer. The channel width and length however will depend on the individual transistor. Spice therefore requires that one of the parameters to transistor and diode elements is a model name, and it is to that model name that the common parameters are given. Model names and the associated parameters are given in a .MODEL card. We may for example have a card for a MOSFET element (NOT a model) with:
Mpullup 100 2 1 0 MPMOS
Somewhere else in the input deck a model card will define the MOSFET model called MPMOS. Note that model names, like element names, can use the first character as a type identifier, although unlike element names, they are not required to:
.MODEL MPMOS PMOS(VTO=-0.8V KP=16U)
In this case, since we are dealing with a p-channel device the threshold voltage is negative. If Spice is to be used for the simulation of circuits built with discrete components, libraries of element models are available for some of the common diodes, transistors and op-amps.