1.6 Component templates

The system matrix may be constructed from predefined component templates such as resistor, diode, mos transistor templates. The following figure and tables present two examples of nonlinear elements: diode template and mos transistor template.
The technique called matrix construction by inspection allows to build the system matrices and identify the location of each element in the matrices as soon as the nodes connected to the elements are defined. The system matrix expands as the elements are introduced from the description file. The element templates describe the positions in the conductance and current arrays for the component. The templates also determine whether the arrays need to be expanded to add additional nodes for new components.

 
 
 
 
The template for diode equivalent 
column for node A
column for node B
voltage array
current array
row for node A
+Gd
-Gd
+Ieq
row for node B
-Gd
+Gd
-Ieq
 
The template for mos transistor equivalent 
D
G
B
S
voltage array
current array
D
gds
-gds
-Ids
G
gm
-gm
0
B
gmbs
-gmbs
0
S
-gds
-gm
-gmbs
gm+gds+gmbs
+Ids
 
As an example we can take a following VHDL-AMS description containing one current source and 4 resistor components.

entity circuit1 is
end circuit1;
architecture structural of circuit1 is
component resistor
generic(resistance: real:=1)
port(terminal a,b: electrical);
end component;
component current_source
generic(dc: real :=0);
port(terminal p,m: out electrical)
end component;
terminal node0,node1,node2,node3: electrical;
begin
CS1:port map(node0,node1) generic map(3);
R1: port map(node1,node2) generic map(5);
R2: port map(node2,node0) generic map(10);
R3: port map(node2,node3) generic map(5);
R4: port map(node3,node0) generic map(10);
end structural; 
The above description will generate the following system matrix:

 
node 0
node 1
node 2
node 3
voltage array
current array
node 0
0.1
-0.1
V0
-0.3
node 1
0.2
-0.2
V1
3
node 2
-0.1
-0.2
0.5
-0.2
V2
0
node 3
-0.2
0.2
V3
0