.SUBCKT — Define a Subcircuit
As an aid to defining a circuit, repetitive circuitry can be enclosed in a subcircuit definition and used as multiple instances in the same circuit. Before the simulation runs, the circuit is expanded to a flat netlist by replacing each invocation of a subcircuit with the circuit elements in the subcircuit definition. There is no limit on the size or complexity of subcircuits.
The end of a subcircuit definition must be a .ends directive.
Here is an example using a subcircuit:
* This is the circuit definition
X1 a b 0 divider
V1 a 0 pulse(0 1 0 0.5μ 0.5μ 0 1μ)
* this is the definition of the subcircuit
.subckt divider n1 n2 n3
r1 n1 n2 1k
r2 n2 n3 1k
.ends
.tran 3μ
.end
Copyright © 1998–2025 by Analog Devices Inc. All Rights Reserved.