Professional Documents
Culture Documents
• Spice 1
• Used the Gummel-Poon model for BJT and Shichman-Hodges Model for JFET
• Written in FORTRAN
• Spice 2
• Include new formulation for voltage-defined elements like inductors and VCVS and
VCIS
• Spice 2 version G.6 became the reference standard for most spice-compatible
programs
• Written in FORTRAN
• Spice 3
• Written in C language
Spice from Different Vendors 5
SPICE-Compatible Vendor
HSPICE Metasoftware
PSPICE Microsim Corporation
IS-Spice IntuSoft
Micro-Cap IV, V Spectrum Software
CountecSpice Countec Microelectronics
TurboSpice Deutsch Research
Tspice Tanner Research
Spectre Cadence
How Does Spice Work 6
• The first line, the title line, may contain any type of text.
• The last line must be the .END statement.
• Each line in the spice deck is called a spice card.
• The order of the remaining lines is not important and does
not affect simulation.
• If a statement is more than one line, the statement can
continue in the next line by putting a plus (+) sign in the first
column of the next line.
What to Remember About the Netlist 14
B GaAsFET K Transformer
C Capacitor L Inductor
D Diode M MOSFET
E Voltage-controlled voltage source Q BJT
F Current-controlled current source R Resistor
S Voltage-controlled switch
H Voltage-controlled current source
T Transmission line
I Independent current source
V Independent voltage source
J JFET
W Current-controlled switch
Spice Scale Convention 17
• Kilo – k, K
• Mega – Meg, MEG, meg
• Giga – g, G
• Tera – T, t
• Micro – u, U
• Milli – m, M
• Nano – n, N
Spice Scale Suffixes 18
• Semiconductor
• Two statements are required to describe a
semiconductor component
• Component description statement
• Model statement
Component Description 21
• Diode
Format:
D<name> <NA> <NK> <model name>
• BJT
Format: Differential Amplifier
Q<name> <C> <B> <E> <model name> model Q1 7 7 6 Model1
<model name> <type> [model parameters] Q2 2 7 6 Model1
Q3 4 7 6 Model1
Q4 2 1 3 Model2
6
Example: Q5 4 5 3 Model2
Q2
Q1 Q3 .model model1 pnp
.model model2 npn
7 .end
2 4
1 5
Q4 Q5
3
Component Description 23
• MOSFET
Format:
M<name> <D> <G> <S> <B> modelname [L=<value>] + MOS Differential amp
[W=<value>] M1 2 2 6 6 pch
6 M2 5 2 6 6 pch
Example: M3 2 1 3 0 nch
M1
2
M2
M4 5 4 3 0 nch
M3 M4
5 .model pch pmos
1 4 .model nch nmos
3 .end
Source Description 24
Source types:
1. Dc 5. Polynomial
2. Sinusoidal 6. Piece-wise linear
3. Pulse 7. Single-frequency
4. Exponential modulation
Voltage and Current Source Description 25
• DC Source
Format:
<source name> <+node> <-node> <source type> <value>
Example: 1 2
R1 Voltage divider
1k
Vi, 5V R2 Vi 1 0 5V
2M
R1 1 2 1k
R2 2 0 2meg
0 .end
Voltage and Current Source Description 26
• AC Source Where:
Sinusoidal Source Format: Vo = offset voltage
Va = peak voltage
Sin (Vo Va Freq) Freq = frequency
Example:
1N4001
Dhw
Half wave rectifier
in out Vi in ground sin (0 311 60)
Dhw in out D1N4001
Vi Rout out ground 1k
Rout
220V
60Hz 1k .end
ground
Voltage and Current Source Description 27
• AC Source
Format: Transistor circuit
Vi 1 0 AC 1
<sourcename> <+node> <-node> AC <magnitude> <phase> Vcc 6 0 DC 10V
6 Rs 1 2 600
VCC
10V C1 2 3 10u
Example: RC 3.3k
C2
R1 6 3 27k
R1 27k 4 Vout R2 3 0 4.7k
1
Rs 2
C1
3
10u
Rc 6 4 3.3k
Q1 RL 20k RE 5 0 680
600 10u 5
C2 4 vout 10u
AC Vi
R2 4.7k
RE 680
RL vout 0 20k
Q1 4 3 5 npnmod
0 .end
Voltage and Current Source Description 28
Example: 3
2
PWL (0 3 10us 3V 15us 6V 40us 6V 45us
+ 2V 60us 2V) 0 T,US
T1 T2 T3 T4 T5 T6
0 10 15 40 45 60
Voltage and Current Source Description 29
R1 L1
Vs
1 2
3 RLC circuit
1.5mH
10 60 Vs 1 0 PWL (0 0 10ns 10V 2ms 10V)
3A +
C1 R1 1 2 60
AC
Vs
4V
2.5uF
R2
20
L1 2 3 1.5m
0
- C1 3 0 2.5uF
t
10ns 2ms R2 3 0 20
0 .end
Pulse Source 30
Format:
Pulse (V1 V2 TD TR TF PW PER) V2
where: V1 – initial voltage
V2 – pulsed voltage
V1
TD – time delay
TR – rise time
PW
TF – fall time TD TR
PER
TF
PW – pulse width
PER - period
Seatwork: 1. Write the netlist for the following circuit: 31
Seatwork: 2. Write the netlist for the following circuit: 32
6
VCC
5V
Q2
Q1 Q3
7 2 4
1 5
IREF Q4 Q5
1mA
3
8
VEE
-5V
Seatwork: 1. Write the netlist for the following circuit: 33
RLC circuit
R1 1 2 60
L1 2 3 1.5m
C1 3 0 2.5uF
R2 3 0 20
.end
Seatwork: 2. Write the netlist for the following circuit: 34
6 Differential Amplifier
VCC VCC 6 0 5V
Q2
5V VEE 3 0 -5V
Q1 Q3 Iref 7 8 1mA
Q1 7 7 6 Model1
Q2 2 7 6 Model1
7 2 4 Q3 4 7 6 Model1
1 5 Q4 2 1 3 Model2
IREF Q4 Q5 Q5 4 5 3 Model2
1mA
3
8 .model model1 pnp
VEE .model model2 npn
-5V .end