SUBCIRCUITS

Back to Home Page


Subcircuits : An Overview

A subcircuit that consists of SPICE elements can be defined and referenced in a fashion similar to device models. The subcircuit is defined in the input deck by a grouping of elementcards; the program then automatically inserts the group of elements wherever the subcircuit is referenced. There is no limit on the size or complexity of subcircuits, and subcircuits may contain other subcircuits. An example of subcircuit usage is given in Appendix A.

Back to Home Page


The .SUBCKT Card

General form:

.SUBCKT subnam N1 < N2 N3 ... >

Examples:

.SUBCKT OPAMP 1 2 3 4

A circuit definition is begun with a .SUBCKT card. SUBNAM is the subcircuit name, and N1, N2, ... are the external nodes, which cannot be zero. The group of element cards which immedi- ately follow the .SUBCKT card define the subcircuit. The last card in a subcircuit definition is the .ENDS card (see below). Control cards may not appear within a subcircuit definition; however, subcircuit definitions may contain anything else, including other subcircuit definitions, device models, and sub- circuit calls (see below). Note that any device models or sub- circuit definitions included as part of a subcircuit definition are strictly local (i.e., such models and definitions are not known outside the subcircuit definition). Also, any element nodes not included on the .SUBCKT card are strictly local, with the exception of 0 (ground) which is always global.

Back to Home Page


The .ENDS Card

General form:

.ENDS

Examples:

.ENDS OPAMP

This card must be the last one for any subcircuit defini- tion. The subcircuit name, if included, indicates which subcir- cuit definition is being terminated; if omitted, all subcircuits being defined are terminated. The name is needed only when nested subcircuit definitions are being made.

Back to Home Page


Subcircuit Calls

General form:

XYYYYYYY N1 < N2 N3 ... > SUBNAM

Examples:

X1 2 4 17 3 1 MULTI

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.

General form:

.TEMP T1 < T2 < T3 ... > >

Examples:

.TEMP -55.0 25.0 125.0

This card specifies the temperatures at which the circuit is to be simulated. T1, T2, ... Are the different temperatures, in degrees C. Temperatures less than -223.0 deg C are ignored. Model data are specified at TNOM degrees (see the .OPTIONS card for TNOM); if the .TEMP card is omitted, the simulation will also be performed at a temperature equal to TNOM.

Back To Home Page

Hosted by www.Geocities.ws

1