0. TABLE OF CONTENTS | 1. INTRODUCTION | 2. CIRCUIT DESCRIPTION |
---|---|---|
3. CIRCUIT ELEMENTS AND MODELS | 4. ANALYSES AND OUTPUT CONTROL | 5. INTERACTIVE INTERPRETER |
6. BIBLIOGRAPHY | APPENDIX A | APPENDIX B |
Each element in the circuit is specified by an element line that contains the element name, the circuit nodes to which the element is connected, and the values of the parameters that determine the electrical characteristics of the element. The first letter of the element name specifies the element type. The format for the SPICE element types is given in what follows. The strings XXXXXXX, YYYYYYY, and ZZZZZZZ denote arbitrary alphanumeric strings. For example, a resistor name must begin with the letter R and can contain one or more characters. Hence, R, R1, RSE, ROUT, and R3AC2ZY are valid resistor names. Details of each type of device are supplied in a following section.
Fields on a line are separated by one or more blanks, a comma, an equal ('=') sign, or a left or right parenthesis; extra spaces are ignored. A line may be continued by entering a '+' (plus) in column 1 of the following line; SPICE continues reading beginning with column 2.
A name field must begin with a letter (A through Z) and cannot contain any delimiters.
A number field may be an integer field (12, -44), a floating point field (3.14159), either an integer or floating point number followed by an integer exponent (1e-14, 2.65e3), or either an integer or a floating point number followed by one of the following scale factors:
T = 1012 | G = 109 | Meg = 106 | K = 103 | mil = 25.4x10-6 |
m = 10-3 | u = 10-6 | n = 10-9 | p = 10-12 | f = 10-15 |
Letters immediately following a number that are not scale factors are ignored, and letters immediately following a scale factor are ignored. Hence, 10, 10V, 10Volts, and 10Hz all represent the same number, and M, MA, MSec, and MMhos all represent the same scale factor. Note that 1000, 1000.0, 1000Hz, 1e3, 1.0e3, 1KHz, and 1K all represent the same number.
POWER AMPLIFIER CIRCUIT TEST OF CAM CELLThe title line must be the first in the input file. Its contents are printed verbatim as the heading for each section of output.
.ENDThe "End" line must always be the last in the input file. Note that the period is an integral part of the name.
* <any comment>Examples:
* RF=1K Gain should be 100 * Check open-loop gain and phase marginThe asterisk in the first column indicates that this line is a comment line. Comment lines may be placed anywhere in the circuit description. Note that SPICE3 also considers any line with leading white space to be a comment.
.MODEL MNAME TYPE(PNAME1=PVAL1 PNAME2=PVAL2 ... )Examples:
.MODEL MOD1 NPN (BF=50 IS=1E-13 VBF=50)Most simple circuit elements typically require only a few parameter values. However, some devices (semiconductor devices in particular) that are included in SPICE require many parameter values. Often, many devices in a circuit are defined by the same set of device model parameters. For these reasons, a set of device model parameters is defined on a separate .MODEL line and assigned a unique model name. The device element lines in SPICE then refer to the model name.
For these more complex device types, each device element line contains the device name, the nodes to which the device is connected, and the device model name. In addition, other optional parameters may be specified for some devices: geometric factors and an initial condition (see the following section on Transistors and Diodes for more details).
MNAME in the above is the model name, and type is one of the following fifteen types:
R | Semiconductor resistor model |
C | Semiconductor capacitor model |
SW | Voltage controlled switch |
CSW | Current controlled switch |
URC | Uniform distributed RC model |
LTRA | Lossy transmission line model |
D | Diode model |
NPN | NPN BJT model |
PNP | PNP BJT model |
NJF | N-channel JFET model |
PJF | P-channel JFET model |
NMOS | N-channel MOSFET model |
PMOS | P-channel MOSFET model |
NMF | N-channel MESFET model |
PMF | P-channel MESFET model |
Parameter values are defined by appending the parameter name followed by an equal sign and the parameter value. Model parameters that are not given a value are assigned the default values given below for each model type. Models, model parameters, and default values are listed in the next section along with the description of device element lines.
.SUBCKT subnam N1 <N2 N3 ...>Examples:
An example of the first approach (linear AC model) is given below for the uA741 opamp. We defined a subcircuit for the opamp. SPICE code for the 741 opamp (see also: Macromodeling with Spice, by J.A. Connelly/P. Choi; and SPICE for Circuits and Electronics Using PSpice, 2nd Ed., Muhammad H. Rashid, Prentice Hall, 1995.)
|
|
* 741 opamp (Rashid) .subckt ua741 1 2 7 Ri 1 2 2.0meg *voltage controlled current source GB 0 3 1 2 0.1M R1 3 0 10K C1 3 0 1.5619UF * voltage controlled voltage source EA 0 5 3 0 2E+5 Ro 5 7 75 .ends ua741 |
.ENDS <SUBNAM>Examples:
.ENDS ua741The "Ends" line must be the last one for any sub-circuit definition. The subcircuit name, if included, indicates which subcircuit definition is being terminated; if omitted, all subcircuits being defined are terminated. The name is needed only when nested subcircuit definitions are being made.
XYYYYYYY N1 <N2 N3 ...> SUBNAMExample:
|
Subcircuits are used in SPICE by specifying pseudo-elements beginning with the letter X, followed by the circuit nodes to be used in expanding the subcircuit.
[Note: the letter X used to specify subcircuits can be set via the variable subinvoke. CDHW]
.INCLUDE filenameExamples:
|