The SPICE Circuit Simulator

This document based on the SPICE documentation distributed by the University of California at Berkeley

What is SPICE

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:

This handout begins by giving a short description and example of a SPICE input file. This is followed by a manual for standard SPICE (i.e. without the bells and whistles associated with most commercial versions).

  1. Input Data

    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:

  2. Circuit Description

    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).

  3. Models

    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:


    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.

  4. Control Cards

    These cards all begin with the character '.' controlling such settings as the temperature of the simulated components; which analyses are to be carried; options such as iteration limits and whether plotted output is required. The .DC card for example is used to sweep an input signal through a given range. Other control cards, .PLOT and .PRINT are used to define what data is plotted or tabulated against the independent variable. Note that plotting in this case refers to a line printer plot! Transient analysis, as might be used to determine the delay through a gate, uses the .TRAN statement. The .TRAN statement itself specifies the time interval over which the analysis is to occur and the stepsize used in tabulating the output. How input signals are to vary during this time is specified using, for an input voltage, a time varying independent voltage source, that is, an element with name Vxxxxx. Details are given in section 6.10 and subsections thereof of the User's Guide.