External and Local Nodes

Nodes defined in the .SUBCKT statement are called the external nodes of the subcircuit. Hence, node 1 in the subcircuit "SUB1" in the example below is an external node and node 101 is an external node for subcircuit "SUB2". The statements in the example below represent the complete input file of an example system to be studied. The .TRAN statement in this input file has not yet been covered but its presence does not affect our discussion here.

In the definition of the subcircuit "SUB1" in the example below, nodes 1, 2, 3, and 0 appear in the device statements. Unless the MAPNODE0 option is turned on through an .OPTION statement, node 0 in a subcircuit is considered to be global in the sense that it is treated to be the same node as node 0 in the main circuit. Any node in the device statements of a subcircuit that is neither an external node nor a global node is considered a local node. So in this example, nodes 2 and 3 are local nodes in subcircuit "SUB1" and node 102 is a local node for subcircuit "SUB2".

Example 5.4

This is the title line
V1 1 0 DC 10
R1 1 2 1K
R2 2 3 1K
R3 3 0 1K
X1 2 SUB1
.SUBCKT SUB1 1
R1 1 2 1K
C1 2 0 1U
R2 2 3 10K
C2 3 0 1U IC=0
XA 2 SUB2
XB 3 SUB2
.SUBCKT SUB2 101
R101 101 102 1K
C101 102 0 1U IC=0
.ENDS SUB2
.ENDS SUB1
...
...
.TRAN 1 0
.END