SlideShare a Scribd company logo
HSPICE
Essential Examples
Dariush Naseh
Shahid Beheshti University of Tehran
Voltage Divider
** Voltage Divider **
R1 in out 1K
R2 out 0 1k
V1 in 0 DC 4V
.OP
.END
R1
1k
R2
1k
V1
4v
0
outin
Dariush Naseh - Shahid Beheshti University
of Tehran
10/2/2016
Subcircuit
** Subcircuit Voltage Divider**
.SUBCKT BLK1 input output
R1 input 1 1k
R2 1 output 1K
.ENDS
X1 in out BLK1
X2 out 0 BLK1
V1 in 0 DC 4v
.OP
.END
V1
4v
BLK1
input output
BLK1
inputoutput
0
Dariush Naseh - Shahid Beheshti University
of Tehran
10/2/2016
To Call a Subcircuit
** Call subcircuit **
.INCLUDE "z:Voltage Divider.sp"
X1 in out BLK
X2 out 0 BLK
VDC in 0 DC 4V
.OP
.END
Dariush Naseh - Shahid Beheshti University
of Tehran
10/2/2016
Switch tclose
** RC switch **
R1 2 3 1k
C1 3 0 1u IC=0
V1 1 0 DC 1v
G1 1 2 VCR PWL(1) 4 5 0 100MEG 1 0.1m
V2 4 5 PWL 0 0 4.9999m 0 5m 1
.TRAN 1n 10m 0.01m
.END
R1
1k
C1
1u
IC = 0
U1
TCLOSE = 5m
1 2
V1
1v
0
1 32
Dariush Naseh - Shahid Beheshti University
of Tehran
10/2/2016
Other SW tclose & Creating Step
Function
** RC Switch 1 **
I1 0 V1 PWL 0 0 0.0000001 1
C1 V1 0 1 IC=0
R1 V1 0 1
G1 V1 V2 VCR PWL(1) v4 0 0 100000meg 1 0.001m
R2 V2 0 1
G2 V2 v3 VCR PWL(1) v5 0 0 100000meg 1 0.001m
C2 V3 0 1 IC=0
V1 V4 0 PWL 0 0 10 0 10.000001 1
V2 V5 0 PWL 0 0 15 0 15.000001 1
.TRAN 10m 20
.END
I1
1A
C1
1
IC = 0
R1
1
U1
TCLOSE = 10s
1 2
R2
1
U2
TCLOSE = 15s
1 2
C2
1
IC = 0
0
V1 V2 V3
Dariush Naseh - Shahid Beheshti University
of Tehran
10/2/2016
Dariush Naseh - Shahid Beheshti University
of Tehran
10/2/2016
Pulse Generator
.TITLE pulse wave
Vin in 0 PULSE 1 -1 0 1n 1n 1m 2m
R1 in out 1k
C1 out 0 100n
.TRAN 10u 10m
.PROBE output=par('V(out)')
.PROBE input=par('V(in)')
.END
C2
100n
out
R2
1k
in
V3
TD = 0
TF = 1n
PW = 1m
PER = 2m
V1 = 1
TR = 1n
V2 = -1
0
Dariush Naseh - Shahid Beheshti University
of Tehran
10/2/2016
Triangle Pulse Generator
.TITLE triangle wave
V1 in 0 PWL 0ms 0 5ms 15v 15ms -15 20ms 0
R1 in out 1k
D1 A out d1n4734
D2 A 0 d1n4734
.MODEL d1N4734 D Is=1.085f Rs=.7945 N=1 Xti=3 Eg=1.11 Cjo=157p M=.2966
+ Vj=.75 Fc=.5 Bv=5.6 Ibv=.37157 Nbv=.64726
.TRAN 20us 20ms
.PROBE vin=par('v(in)')
.PROBE Vout=par('v(out)')
.END
V1
R1
1k
D1
D1N4734
D2
D1N4734
in
A
out
0
Dariush Naseh - Shahid Beheshti University
of Tehran
10/2/2016
Dependent Sources
** VCCS **
G1 0 1 VCCS 0 2 2
R1 1 2 1
I1 0 2 DC 1
R2 2 3 1
V1 3 0 DC 2
.OP
.END
V1
2v
R1
1
R2
1
+
-
G1
GAIN = 2
I1
1A
0
0
1 32
0
2
Dariush Naseh - Shahid Beheshti University
of Tehran
10/2/2016
Dependent sourse , another Ex.
(VCCS & CCVS)
** Other example in VCCS and CCCS **
I1 V1 V3 DC 1
R3 A V2 1
R1 V2 V3 1
R2 V3 0 1
R4 v1 V4 1
V1 V2 0 2
H1 V4 0 CCVS Vc 4
Vc V1 A DC 0
G1 V2 V4 VCCS V3 V2 2
.OP
.END
V1
2V
+
-
G1
GAIN = 2
R1
1
R2
1
V3
I1
1AR3
1
V2
R4
1
V4
H1
GAIN = 4 0
V1 A
V2
V3
Dariush Naseh - Shahid Beheshti University
of Tehran
10/2/2016
Ideal Transformer
** Rectifire with RC Filter **
E1 3 4 TRANSFORMER 1 2 10
Vin 1 2 SIN 0 318 50 0 0 0
D1 3 out d1n4007
D2 0 3 d1n4007
D3 4 out d1n4007
D4 0 4 d1n4007
.MODEL d1n4007 D IS=1.09774E-008 n=1.78309 Rs=0.0414388
+ Eg=1.11 Xti=3 Cjo=2.8173E-011 Vj=0.50772
+ m=0.318974 Fc=0.5 TT=9.85376E-006 Bv=1100 Ibv=0.1 Kf=0
R1 Out 0 1k
C1 out 0 220u
.TRAN 0.1m 1000m START=900m
.PROBE IDiode=par('I(D1)')
.PROBE Vtrans=par('V(3)-V(4)')
.END
V1
FREQ = 50Hz
VAMPL = 318v
TX1 D1
D1N4007
D2
D1N4007
D3
D1N4007
D4
D1N4007
R1
1k
C1
220uF
Out3
4
1
2
Dariush Naseh - Shahid Beheshti University
of Tehran
10/2/2016
Dariush Naseh - Shahid Beheshti University
of Tehran
10/2/2016
Linear mutual inductor
.Title Linear mutual inductor
R1 1 2 2
L1 2 0 8
L2 3 0 200
K1 L1 L2 1
R3 3 0 200
Vs 1 0 AC 50 0
.AC DEC 200 100 100k
.PROBE vtarget=par('V(2)')
.PROBE Phase=par('VP(2)')
.END
V1
50v
ACPHASE = 0
R1
2
L1
8
L2
200 R2
200
0
1 2 3
K
COUPLING=
K1
COUPLING = 1
Dariush Naseh - Shahid Beheshti University
of Tehran
10/2/2016
Ideal Op-Amp
.TITLE Ideal Op-Amp
.INCLUDE "Z:7805.sp"
Vi in 0 DC 15v
x1 in 2 out LM7805
R1 3 0 1k
R2 1 0 1k
R3 out 1 2k
E1 2 3 OPAMP 1 2
.TRAN 0.1m 10m
.END
V1
15v
U1
OPAMP
+
-
OUT
R1
1k
R2
1k
R3
2k
U2
LM7805C
IN
1
OUT
2
GND
3
0
in out
1
2
0
0
3
Dariush Naseh - Shahid Beheshti University
of Tehran
10/2/2016
Identifying Rin & Rout & Av in OPAMP
.TITLE op-amp
V1 2 0 DC 1
V2 1 0 DC 100m
R1 2 4 500
R2 1 3 5k
R3 3 0 10k
R4 4 3 100K **Rin=100k**
R5 4 6 1k
R6 5 6 1k ** Rout=1k**
R7 6 0 1k
E1 5 0 OPAMP 3 4 100K **Av=100K**
.DC V1 LIN 499 1m 500m
.PROBE Vout=par('v(6)')
.END
V1
1v
V2
100m
U1
OPAMP
+
-
OUT
0
0
R1
500
R2
5k
R3
10k
0
R5
1k
R7
1k
0
6
31
42
Dariush Naseh - Shahid Beheshti University
of Tehran
10/2/2016
Plotting characteristic curve of Doid
(source sweeping)
** characteristic curve of Diod **
R1 in out 1k
D1 out 0 d1n4148
V1 in 0 DC 1v
.MODEL d1n4148 D Is=2.682n N=1.836 Rs=.5664 Xti=3 Eg=1.11 Cjo=4p
+ M=.3333 Vj=.5 Fc=.5 Bv=100 Ibv=100u Tt=11.54n
.DC V1 LIN 300 0 30 SWEEP TEMP LIN 2 25 50
.PROBE IDiode=par('I(D1)')
.END
D1
D1N4148
V1
1v
R1
1k
0
outin
Dariush Naseh - Shahid Beheshti University
of Tehran
10/2/2016
Maximum Power Transfer
(elements sweeping)
** Maxium Power Transfer**
.PARAM r=1
R1 in out r
R2 out 0 10k
V1 in 0 DC 10v
.DC r LIN 400 8k 12k
.PLOT P(R1)
.END
V1
10v
R1
{r}
0
outin
PARAMETERS:
r = 1k
R2
10k
Dariush Naseh - Shahid Beheshti University
of Tehran
10/2/2016
Thevenin Equivqlent & IF-ELSE
Structure
.TITLE Thevenin equivqlent
R1 1 2 1
R2 2 3 1
R3 2 4 1
VSENSE 4 0 DC 0
H1 3 0 CCVS VSENSE 0.5
.PARAM k=0
.IF(K==1)
{
Vin 1 0 DC 1v
.TRAN 0.1m 10m
.PROBE Rin=par('-V(1)/I(Vin)')
}
.ELSEIF(K==0)
{
Vin 1 0 DC 0
.TRAN 0.1m 10m
.PROBE ISC=par('I(Vin)')
}
.ENDIF
.END
R1
1
R2
1
R3
1
H1
GAIN = 0.5
0
2 31
0
VSENSE
4
Dariush Naseh - Shahid Beheshti University
of Tehran
10/2/2016
.SENS Command
Sensitivity of element’s variation
.TITLE Self Bias Sensivity ro Vcc
VCC VCC 0 DC 15v
RB1 VCC B 3.9k
RB2 B 0 1.5k
RC VCC C 470
RE E 0 180
Q1 C B E BC107A
.MODEL BC107A NPN Is=7.049f Xti=3 Eg=1.11 Vaf=116.3 Bf=375.5 Ise=7.049f
+ Ne=1.281 Ikf=4.589 Nk=.5 Xtb=1.5 Br=2.611 Isc=121.7p Nc=1.865
+ Ikr=5.313 Rc=1.464 Cjc=5.38p Mjc=.329 Vjc=.6218 Fc=.5 Cje=11.5p
+ Mje=.2717 Vje=.5 Tr=10n Tf=451p Itf=6.194 Xtf=17.43 Vtf=10
.OP
.SENS IC(Q1)
.END
VCC
15v
Q1
BC107A
RC
470
RB1
3.9k
RE
180
RB2
1.5k
0
00
dc sensitivities of output ic(q1)
element element element normalized
name value sensitivity sensitivity
(amps/unit) (amps/percent)
0:rb1 3.9000k -4.1551u -162.0503u
0:rb2 1.5000k 10.4832u 157.2486u
0:rc 470.0000 -101.2284n -475.7735n
0:re 180.0000 -99.2755u -178.6959u
0:vcc 15.0000 1.4890m 223.3519u
Dariush Naseh - Shahid Beheshti University
of Tehran
10/2/2016
Sweeping the specifications of models
.TITLE DC sweep
.PARAM k=5.6
Vi in 0 1v
R1 in out 1k
D1 0 out d1n4734
.MODEL d1N4734 D Is=1.085f Rs=.7945 N=1 Xti=3 Eg=1.11 Cjo=157p
+ M=.2966 Vj=.75 Fc=.5 Bv=k Ibv=.37157 Nbv=.64726
.DC Vi LIN 300 -15 +15 SWEEP k LIN 6 1.6 6.6
.PROBE target=par('V(out)')
.END
D1
D1N4734
R1
1kV1
1v
0
outin
Dariush Naseh - Shahid Beheshti University
of Tehran
10/2/2016
Output characteristic curve of BJT
.TITLE Curve
IDC 0 B DC 1m
VDC C 0 DC 5V
V1 E 0 DC 0
Q1 C B E BC107A
.MODEL BC107A NPN Is=7.049f Xti=3 Eg=1.11 Vaf=116.3 Bf=375.5 Ise=7.049f
+ Ne=1.281 Ikf=4.589 Nk=.5 Xtb=1.5 Br=2.611 Isc=121.7p Nc=1.865
+ Ikr=5.313 Rc=1.464 Cjc=5.38p Mjc=.329 Vjc=.6218 Fc=.5 Cje=11.5p
+ Mje=.2717 Vje=.5 Tr=10n Tf=451p Itf=6.194 Xtf=17.43 Vtf=10
.DC VDC LIN 200 0 20 SWEEP IDC LIN 5 0 40u
.PROBE I=par('IC(Q1)')
.END
IDC
1m
Q1
BC107A VDC
5v
00 0
Dariush Naseh - Shahid Beheshti University
of Tehran
10/2/2016
ICQ-B Curve in BJT
.TITLE Beta
IDC 0 B DC 1m
VDC C 0 DC 5v
V1 E 0 DC 0
Q1 C B E BC107A
.MODEL BC107A NPN Is=7.049f Xti=3 Eg=1.11 Vaf=116.3 Bf=375.5 Ise=7.049f
+ Ne=1.281 Ikf=4.589 Nk=.5 Xtb=1.5 Br=2.611 Isc=121.7p Nc=1.865
+ Ikr=5.313 Rc=1.464 Cjc=5.38p Mjc=.329 Vjc=.6218 Fc=.5 Cje=11.5p
+ Mje=.2717 Vje=.5 Tr=10n Tf=451p Itf=6.194 Xtf=17.43 Vtf=10
.DC IDC LIN 10000 1u 10m SWEEP VDC LIN 3 5 15
.PROBE Beta=par('IC(Q1)/IB(Q1)')
.PROBE ICollector=par('(IC(Q1))')
.END
IDC
1m
Q1
BC107A VDC
5v
00 0
Dariush Naseh - Shahid Beheshti University
of Tehran
10/2/2016
HFE & Transition Frequency of BJT
** HFE and transition frequency **
.PARAM k=1u
VDC C 0 DC 5v
IDC 0 B DC k AC 1 0
V1 E 0 DC 0
Q1 C B E BC107A
.MODEL BC107A NPN Is=7.049f Xti=3 Eg=1.11 Vaf=116.3 Bf=375.5 Ise=7.049f
+ Ne=1.281 Ikf=4.589 Nk=.5 Xtb=1.5 Br=2.611 Isc=121.7p Nc=1.865
+ Ikr=5.313 Rc=1.464 Cjc=5.38p Mjc=.329 Vjc=.6218 Fc=.5 Cje=11.5p
+ Mje=.2717 Vje=.5 Tr=10n Tf=451p Itf=6.194 Xtf=17.43 Vtf=10
.AC DEC 200 1 1G SWEEP K LIN 3 5u 15u
.probe beta=par('IC(Q1)/IB(Q1)')
.end
IDC
1u
Q1
BC107A VDC
5v
00 0
Dariush Naseh - Shahid Beheshti University
of Tehran
10/2/2016
Wien Bridge Oscillator
.TITLE wien brigde oscillator
.INCLUDE "Z:LM741.sp"
Vcc Vcc 0 DC 12v
Vee 0 Vee DC 12v
X1 3 2 Vcc Vee 1 LM741
R1 5 2 18k
R2 2 0 10k
R3 3 4 1.6k
R4 3 0 1.6k
R5 1 5 4.7k
C1 4 1 10n
C2 3 0 10n
D1 5 1 d1n4148
D2 1 5 d1n4148
I1 0 3 PWL 0 0 1us 1mA 4us 1mA 4.0001us 0
.MODEL d1n4148 D Is=2.682n N=1.836 Rs=.5664 Ikf=44.17m Xti=3 Eg=1.11 Cjo=4p
+ M=.3333 Vj=.5 Fc=.5 Isr=1.565n Nr=2 Bv=100 Ibv=100u Tt=11.54n
.TRAN 1n 2m
.PROBE vout=par('V(1)')
.END
U2
LM741/NS
+
3
-
2
V+
7
V-
4
OUT
6
OS2
5
OS1
1
R1
18k
R2
10k
R3
1.6k
R4
1.6k
C1
10n
C2
10n
0
00
2
3
4
1
V1
12v
V2
12v
0
Vcc
Vee
Vee
Vcc
R5
4.7k
D1
D1N4148
D2
D1N4148
5
I1
0
Dariush Naseh - Shahid Beheshti University
of Tehran
10/2/2016
Power Amplifiers in B-Class and
Fourier Analysis
.TITLE Power amplifire in B-Class
VCC VCC 0 12v
Vee 0 Vee 12v
Q1 Vcc B out BD135
Q2 Vee B out BD136
RL out 0 100
R1 in B 50
Vin in 0 Sin 0 8V 10KHz 0 0 0
.MODEL BD135 NPN IS = 4.815E-14 NF = 0.9897 ISE = 1.389E-14 NE = 1.6 BF = 124.2
+ IKF = 1.6 VAF = 222 NR = 0.9895 ISC = 1.295E-13 NC = 1.183
+ BR = 13.26 IKR = 0.29 VAR = 81.4 RB = 0.5 IRB = 1E-06 RBM = 0.5
+ RE = 0.165 RC = 0.096 XTB = 0 EG = 1.11 XTI = 3 CJE = 1.243E-10
+ VJE = 0.7313 MJE = 0.3476 TF = 6.478E-10 XTF = 29 VTF = 2.648
+ ITF = 3.35 PTF = 0 CJC = 3.04E-11 VJC = 0.5642 MJC = 0.4371
+ XCJC = 0.15 TR = 1E-32 CJS = 0 VJS = 0.75 MJS = 0.333 FC = 0.9359
.MODEL BD136 PNP IS = 7.401E-14 NF = 0.9938 ISE = 4.104E-16 NE = 1.054 BF = 336.5
+ IKF = 0.1689 VAF = 22.47 NR = 0.9913 ISC = 1.290E-14 NC = 1.100
+ BR = 13.91 IKR = 9.888E-2 VAR = 30.00 RB = 0.500 IRB = 1E-06
+ RBM = 0.500 RE = 0.208 RC = 5.526E-02 XTB = 0 EG = 1.11 XTI = 3
+ CJE = 1.066E-10 VJE = 0.6900 MJE = 0.3676 TF = 2.578E-10 XTF = 13.56
+ VTF = 2.366 ITF = 1.3040 PTF = 0 CJC = 5.234E-11 VJC = 0.6431
+ MJC = 0.4436 XCJC = 0.440 TR = 1E-25 CJS = 0 VJS = 0.75 MJS = 0.333
+ FC = 0.990
.TRAN 0.1u 1m START=0.8m
.PROBE output=par('v(out)')
.FOUR 10k v(out)
.END
Q1
BD135
Q2
BD136
Vcc
12
Vee
12RL
100
R1
50
B
Vcc
Vee 0
out
Vee
Vcc
0
V3
FREQ = 10k
VAMPL = 8v
VOFF = 0
0
in
Dariush Naseh - Shahid Beheshti University
of Tehran
10/2/2016
Dariush Naseh - Shahid Beheshti University
of Tehran
10/2/2016
.MEASURE Command
(Calculation of output DC Level)
.TLTEL CE
VCC VCC 0 DC 12v
RB1 VCC B 100K
RB2 B 0 27k
RC VCC C 4.7k
RE1 E 1 47
RE2 1 0 3.9k
RS in 2 50
CB 1 0 470u
CC 2 B 10u
Q1 C B E BC107A
.MODEL BC107A NPN Is=7.049f Xti=3 Eg=1.11 Vaf=116.3 Bf=375.5 Ise=7.049f
+ Ne=1.281 Ikf=4.589 Nk=.5 Xtb=1.5 Br=2.611 Isc=121.7p Nc=1.865
+ Ikr=5.313 Rc=1.464 Cjc=5.38p Mjc=.329 Vjc=.6218 Fc=.5 Cje=11.5p
+ Mje=.2717 Vje=.5 Tr=10n Tf=451p Itf=6.194 Xtf=17.43 Vtf=10
Vin in 0 0 AC 1 Sin 0 5mV 10kHz
.op
.AC DEC 200 1 100MEG
.TRAN 0.1us 1ms
.PROBE AC Gain=par('VDB(c)')
.PROBE AC Phase=par('-ABS(VP(c))')
.MEASURE TRAN val avg v(c) from=0 to=0.1ms
.PROBE TRAN output=par('V(c)-val')
.PROBE AC Rin=par('V(in)/I(Rs)')
.END
VCC
12vRC
4.7k
RB1
4.7k
RB2
27k
RE1
47
Q1
BC107A
RE2
3.9k
RS
50
C1
10u
V2
FREQ = 10k
VAMPL = 5m
VOFF = 0
AC = 1
00
B
C2
470u
0
1
0in 2
Vcc
0
Dariush Naseh - Shahid Beheshti University
of Tehran
10/2/2016
Dariush Naseh - Shahid Beheshti University
of Tehran
10/2/2016
Example of .MEASURE Command
WHEN-FIND
TITLE measure
Vin in 0 PWL 0 0 1ns 1v 10ms 1 10.0000001m 0
R1 in out 1k
C1 out 0 1u
.TRAN 20u 20ms
.MEASURE TRAN val1 FIND I(R1) AT=1m
.MEASURE TRAN Val2 WHEN V(out)='0.5' CROSS=2
.PROBE input=par('V(in)')
.PROBE output=par('V(out)')
.END
R1
1k
C1
1u
0
V1
outin
Dariush Naseh - Shahid Beheshti University
of Tehran
10/2/2016
Square wave, MEASURMET of RISE TIME
(MIN,MAX,PP &TRIG… TARG… )
.TITLE Rise Time
Vi in 0 PULSE 1 -1 0 1p 1p 1m 2m
R1 in out 1k
C1 out 0 100n
.TRAN 0.1u 10m
.MEASURE MAX MAX V(out) FROM=6.1m TO=8m
.MEASURE MIN MIN V(out) FROM=6.1m To=8m
.MEASURE PP PP V(out) FROM=6.1m TO=8m
.MEASURE TRAN T1 TRIG V(in) val=1 TD=6.1ms RISE=1 TARG V(out) val=0.1*PP+MIN TD=6.1ms RISE=1
.MEASURE TRAN T2 TRIG V(in) val=1 TD=6.1ms RISE=1 TARG V(out) val=0.9*PP+MIN TD=6.1ms RISE=1
.MEASURE TRAN Tr=param'T2-T1'
.PROBE in=par('v(in)')
.PROBE OUT=par('V(out)')
.END
Dariush Naseh - Shahid Beheshti University
of Tehran
10/2/2016
.PZ Command
Pole & Zero
.TITLE Pole and zero
V1 in 0 DC 0 AC 1
R1 in out 1k
C1 out 0 100n
.AC DEC 200 1 100k
.PROBE gain=par('VDB(out)')
.PROBE pahse=par('VP(out)')
.PZ v(out) v1
.END
V2
1Vac
0Vdc
out
0
R1
1k
C1
100n
in
Dariush Naseh - Shahid Beheshti University
of Tehran
10/2/2016
.TF Command
(Transfer Function)
.TITLE Diffrentional Amplifire
VCC VCC 0 12v
VEE 0 VEE 12v
V1 in 0 DC 0
Q1 1 1 VCC BC177
Q2 2 1 VCC BC177
Q3 1 in 3 BC107A
Q4 2 0 3 BC107A
Q5 3 4 6 BC107A
R1 4 VEE 1.8k
R2 4 0 22k
R3 6 VEE 100
.MODEL BC107A NPN Is=7.049f Xti=3 Eg=1.11 Vaf=116.3 Bf=375.5 Ise=7.049f
+ Ne=1.281 Ikf=4.589 Nk=.5 Xtb=1.5 Br=2.611 Isc=121.7p Nc=1.865
+ Ikr=5.313 Rc=1.464 Cjc=5.38p Mjc=.329 Vjc=.6218 Fc=.5 Cje=11.5p
+ Mje=.2717 Vje=.5 Tr=10n Tf=451p Itf=6.194 Xtf=17.43 Vtf=10
.MODEL BC177 PNP Is=336.7f Xti=3 Eg=1.11 Vaf=55.46 Bf=154.4 Ise=412.1f
+ Ne=1.429 Ikf=.2994 Nk=.7028 Xtb=1.5 Br=3.99 Isc=1.03n Nc=1.958
+ Ikr=9.726 Rc=1.833 Cjc=11p Mjc=.2223 Vjc=.5 Fc=.5 Cje=33p
+ Mje=.3333 Vje=.5 Tr=10n Tf=847.7p Itf=2.198 Xtf=23.26 Vtf=10
.OP
.TF v(2) v1
.END
Q1
BC177
Q2
BC177
Q3
BC107A
Q4
BC107A
Q5
BC107A
V1
12
V2
12
VEE
VCC
R1
100
R2
1.8k
R3
22k
VEE
0
VCC
0
V3VAC=1
VDC=0
0
Vin
Dariush Naseh - Shahid Beheshti University
of Tehran
10/2/2016
LAPLACE Transform Simulation
TITLE LAPLACE
ERC 2 0 LAPLACE 1 0 1/1,1E-3
Vin 1 0 DC 0 AC 1 sin 0 1 159
.AC DEC 200 0.1 100MEG
.TRAN 0.6u 60m
.PROBE TRAN out=par('V(2)')
.PROBE AC ampel=par('VDB(2)')
.PROBE AC phase=par('VP(2)')
.MEASURE AC MAX FIND VDB(2) AT=1
.MEASURE AC cutoff WHEN vDB(2)='MAX-3'
.END
V2
R1
1k
0
C1
1u
Dariush Naseh - Shahid Beheshti University
of Tehran
10/2/2016

More Related Content

What's hot

Transistor Transistor Logic
Transistor Transistor LogicTransistor Transistor Logic
Transistor Transistor Logic
surat murthy
 
Buck converter
Buck converterBuck converter
Buck converter
Troy Stahley
 
Latch & Flip-Flop Design.pptx
Latch & Flip-Flop Design.pptxLatch & Flip-Flop Design.pptx
Latch & Flip-Flop Design.pptx
GargiKhanna2
 
Design of Buck Converter
Design of Buck ConverterDesign of Buck Converter
Design of Buck Converter
Akhil Syamalan
 
Analog Layout and Process Concern
Analog Layout and Process ConcernAnalog Layout and Process Concern
Analog Layout and Process Concern
asinghsaroj
 
Types of MOSFET Applications and Working Operation
Types of MOSFET Applications and Working OperationTypes of MOSFET Applications and Working Operation
Types of MOSFET Applications and Working Operation
Edgefxkits & Solutions
 
Cmos logic
Cmos logicCmos logic
CMOS logic circuits
CMOS logic circuitsCMOS logic circuits
CMOS logic circuits
Mahesh_Naidu
 
mos transistor
mos transistormos transistor
mos transistor
harshalprajapati78
 
Pass Transistor Logic
Pass Transistor LogicPass Transistor Logic
Pass Transistor Logic
Sudhanshu Janwadkar
 
36.voltage divider bias
36.voltage divider bias36.voltage divider bias
36.voltage divider bias
DoCircuits
 
Low dropout regulator(ldo)
Low dropout regulator(ldo)Low dropout regulator(ldo)
Low dropout regulator(ldo)
altaf423
 
Mosfet short channel effects
Mosfet short channel effectsMosfet short channel effects
Mosfet short channel effects
kesana Bala Gopi
 
Clippers and clampers
Clippers and clampersClippers and clampers
Clippers and clampers
taranjeet10
 
JFET
JFETJFET
RF Circuit Design - [Ch3-2] Power Waves and Power-Gain Expressions
RF Circuit Design - [Ch3-2] Power Waves and Power-Gain ExpressionsRF Circuit Design - [Ch3-2] Power Waves and Power-Gain Expressions
RF Circuit Design - [Ch3-2] Power Waves and Power-Gain Expressions
Simen Li
 
CMOS Logic
CMOS LogicCMOS Logic
Voltage Controlled Oscillator Design - Short Course at NKFUST, 2013
Voltage Controlled Oscillator Design - Short Course at NKFUST, 2013Voltage Controlled Oscillator Design - Short Course at NKFUST, 2013
Voltage Controlled Oscillator Design - Short Course at NKFUST, 2013
Simen Li
 
Common Emitter Configuration and Collector Curve
Common Emitter Configuration and Collector CurveCommon Emitter Configuration and Collector Curve
Common Emitter Configuration and Collector Curve
Zeeshan Rafiq
 
Analog Layout design
Analog Layout design Analog Layout design
Analog Layout design
slpinjare
 

What's hot (20)

Transistor Transistor Logic
Transistor Transistor LogicTransistor Transistor Logic
Transistor Transistor Logic
 
Buck converter
Buck converterBuck converter
Buck converter
 
Latch & Flip-Flop Design.pptx
Latch & Flip-Flop Design.pptxLatch & Flip-Flop Design.pptx
Latch & Flip-Flop Design.pptx
 
Design of Buck Converter
Design of Buck ConverterDesign of Buck Converter
Design of Buck Converter
 
Analog Layout and Process Concern
Analog Layout and Process ConcernAnalog Layout and Process Concern
Analog Layout and Process Concern
 
Types of MOSFET Applications and Working Operation
Types of MOSFET Applications and Working OperationTypes of MOSFET Applications and Working Operation
Types of MOSFET Applications and Working Operation
 
Cmos logic
Cmos logicCmos logic
Cmos logic
 
CMOS logic circuits
CMOS logic circuitsCMOS logic circuits
CMOS logic circuits
 
mos transistor
mos transistormos transistor
mos transistor
 
Pass Transistor Logic
Pass Transistor LogicPass Transistor Logic
Pass Transistor Logic
 
36.voltage divider bias
36.voltage divider bias36.voltage divider bias
36.voltage divider bias
 
Low dropout regulator(ldo)
Low dropout regulator(ldo)Low dropout regulator(ldo)
Low dropout regulator(ldo)
 
Mosfet short channel effects
Mosfet short channel effectsMosfet short channel effects
Mosfet short channel effects
 
Clippers and clampers
Clippers and clampersClippers and clampers
Clippers and clampers
 
JFET
JFETJFET
JFET
 
RF Circuit Design - [Ch3-2] Power Waves and Power-Gain Expressions
RF Circuit Design - [Ch3-2] Power Waves and Power-Gain ExpressionsRF Circuit Design - [Ch3-2] Power Waves and Power-Gain Expressions
RF Circuit Design - [Ch3-2] Power Waves and Power-Gain Expressions
 
CMOS Logic
CMOS LogicCMOS Logic
CMOS Logic
 
Voltage Controlled Oscillator Design - Short Course at NKFUST, 2013
Voltage Controlled Oscillator Design - Short Course at NKFUST, 2013Voltage Controlled Oscillator Design - Short Course at NKFUST, 2013
Voltage Controlled Oscillator Design - Short Course at NKFUST, 2013
 
Common Emitter Configuration and Collector Curve
Common Emitter Configuration and Collector CurveCommon Emitter Configuration and Collector Curve
Common Emitter Configuration and Collector Curve
 
Analog Layout design
Analog Layout design Analog Layout design
Analog Layout design
 

Similar to HSpice Essential Examples

Formulario fisica dos
Formulario fisica dosFormulario fisica dos
Formulario fisica dos
Mynor Garcia
 
PSpice Tutorial
PSpice TutorialPSpice Tutorial
PSpice Tutorial
ankitgdoshi
 
nfc
nfcnfc
Transient analysis of clamping circuits
Transient analysis of clamping circuitsTransient analysis of clamping circuits
Transient analysis of clamping circuits
ANILPRASAD58
 
Chapter 04 is
Chapter 04 isChapter 04 is
Chapter 04 is
SHUBHAMMittal186
 
T6 1 ph-ac
T6 1 ph-acT6 1 ph-ac
T6 1 ph-ac
Satyakam
 
Solutions manual for microelectronic circuits analysis and design 3rd edition...
Solutions manual for microelectronic circuits analysis and design 3rd edition...Solutions manual for microelectronic circuits analysis and design 3rd edition...
Solutions manual for microelectronic circuits analysis and design 3rd edition...
Gallian394
 
MOSFET Simulation (16FEB2012)
MOSFET Simulation (16FEB2012)MOSFET Simulation (16FEB2012)
MOSFET Simulation (16FEB2012)
Tsuyoshi Horigome
 
PSpiceによる擬似共振電源回路シミュレーション事例
PSpiceによる擬似共振電源回路シミュレーション事例PSpiceによる擬似共振電源回路シミュレーション事例
PSpiceによる擬似共振電源回路シミュレーション事例
Tsuyoshi Horigome
 
Datasheet
DatasheetDatasheet
Datasheet
Gavril Giurgi
 
SPICEのご紹介
SPICEのご紹介SPICEのご紹介
SPICEのご紹介
Tsuyoshi Horigome
 
Lab 5
Lab 5Lab 5
シミュレーション事例:擬似共振電源回路シミュレーション Quasi-Resonant Switching Power Supply using FA5541
シミュレーション事例:擬似共振電源回路シミュレーション Quasi-Resonant Switching Power Supply using FA5541シミュレーション事例:擬似共振電源回路シミュレーション Quasi-Resonant Switching Power Supply using FA5541
シミュレーション事例:擬似共振電源回路シミュレーション Quasi-Resonant Switching Power Supply using FA5541
マルツエレック株式会社 marutsuelec
 
12 transformer
12 transformer12 transformer
12 transformer
ramavatarmeena
 
Ch15p
Ch15pCh15p
HA17741 General Purpose Operational Amplifier
HA17741 General Purpose Operational AmplifierHA17741 General Purpose Operational Amplifier
HA17741 General Purpose Operational Amplifier
Yong Heui Cho
 
Current-Transformer-ppt.ppt
Current-Transformer-ppt.pptCurrent-Transformer-ppt.ppt
Current-Transformer-ppt.ppt
SelvamuthukumarExcel
 
180953548-Current-Transformer-ppt.ppt
180953548-Current-Transformer-ppt.ppt180953548-Current-Transformer-ppt.ppt
180953548-Current-Transformer-ppt.ppt
electrical1012000
 
Cmos digital integrated circuits analysis and design 4th edition kang solutio...
Cmos digital integrated circuits analysis and design 4th edition kang solutio...Cmos digital integrated circuits analysis and design 4th edition kang solutio...
Cmos digital integrated circuits analysis and design 4th edition kang solutio...
vem2001
 
Circuitos ELECTRICOS EJEMPLOS TAREA ELECTRICIDAD Y MAGNETISMO
Circuitos ELECTRICOS EJEMPLOS TAREA ELECTRICIDAD Y MAGNETISMOCircuitos ELECTRICOS EJEMPLOS TAREA ELECTRICIDAD Y MAGNETISMO
Circuitos ELECTRICOS EJEMPLOS TAREA ELECTRICIDAD Y MAGNETISMO
bofo900393
 

Similar to HSpice Essential Examples (20)

Formulario fisica dos
Formulario fisica dosFormulario fisica dos
Formulario fisica dos
 
PSpice Tutorial
PSpice TutorialPSpice Tutorial
PSpice Tutorial
 
nfc
nfcnfc
nfc
 
Transient analysis of clamping circuits
Transient analysis of clamping circuitsTransient analysis of clamping circuits
Transient analysis of clamping circuits
 
Chapter 04 is
Chapter 04 isChapter 04 is
Chapter 04 is
 
T6 1 ph-ac
T6 1 ph-acT6 1 ph-ac
T6 1 ph-ac
 
Solutions manual for microelectronic circuits analysis and design 3rd edition...
Solutions manual for microelectronic circuits analysis and design 3rd edition...Solutions manual for microelectronic circuits analysis and design 3rd edition...
Solutions manual for microelectronic circuits analysis and design 3rd edition...
 
MOSFET Simulation (16FEB2012)
MOSFET Simulation (16FEB2012)MOSFET Simulation (16FEB2012)
MOSFET Simulation (16FEB2012)
 
PSpiceによる擬似共振電源回路シミュレーション事例
PSpiceによる擬似共振電源回路シミュレーション事例PSpiceによる擬似共振電源回路シミュレーション事例
PSpiceによる擬似共振電源回路シミュレーション事例
 
Datasheet
DatasheetDatasheet
Datasheet
 
SPICEのご紹介
SPICEのご紹介SPICEのご紹介
SPICEのご紹介
 
Lab 5
Lab 5Lab 5
Lab 5
 
シミュレーション事例:擬似共振電源回路シミュレーション Quasi-Resonant Switching Power Supply using FA5541
シミュレーション事例:擬似共振電源回路シミュレーション Quasi-Resonant Switching Power Supply using FA5541シミュレーション事例:擬似共振電源回路シミュレーション Quasi-Resonant Switching Power Supply using FA5541
シミュレーション事例:擬似共振電源回路シミュレーション Quasi-Resonant Switching Power Supply using FA5541
 
12 transformer
12 transformer12 transformer
12 transformer
 
Ch15p
Ch15pCh15p
Ch15p
 
HA17741 General Purpose Operational Amplifier
HA17741 General Purpose Operational AmplifierHA17741 General Purpose Operational Amplifier
HA17741 General Purpose Operational Amplifier
 
Current-Transformer-ppt.ppt
Current-Transformer-ppt.pptCurrent-Transformer-ppt.ppt
Current-Transformer-ppt.ppt
 
180953548-Current-Transformer-ppt.ppt
180953548-Current-Transformer-ppt.ppt180953548-Current-Transformer-ppt.ppt
180953548-Current-Transformer-ppt.ppt
 
Cmos digital integrated circuits analysis and design 4th edition kang solutio...
Cmos digital integrated circuits analysis and design 4th edition kang solutio...Cmos digital integrated circuits analysis and design 4th edition kang solutio...
Cmos digital integrated circuits analysis and design 4th edition kang solutio...
 
Circuitos ELECTRICOS EJEMPLOS TAREA ELECTRICIDAD Y MAGNETISMO
Circuitos ELECTRICOS EJEMPLOS TAREA ELECTRICIDAD Y MAGNETISMOCircuitos ELECTRICOS EJEMPLOS TAREA ELECTRICIDAD Y MAGNETISMO
Circuitos ELECTRICOS EJEMPLOS TAREA ELECTRICIDAD Y MAGNETISMO
 

Recently uploaded

Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
IJECEIAES
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
shadow0702a
 
Software Quality Assurance-se412-v11.ppt
Software Quality Assurance-se412-v11.pptSoftware Quality Assurance-se412-v11.ppt
Software Quality Assurance-se412-v11.ppt
TaghreedAltamimi
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
Madan Karki
 
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURSCompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
RamonNovais6
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
Yasser Mahgoub
 
Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
Divyanshu
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 
artificial intelligence and data science contents.pptx
artificial intelligence and data science contents.pptxartificial intelligence and data science contents.pptx
artificial intelligence and data science contents.pptx
GauravCar
 
cnn.pptx Convolutional neural network used for image classication
cnn.pptx Convolutional neural network used for image classicationcnn.pptx Convolutional neural network used for image classication
cnn.pptx Convolutional neural network used for image classication
SakkaravarthiShanmug
 
Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...
Prakhyath Rai
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
VICTOR MAESTRE RAMIREZ
 
People as resource Grade IX.pdf minimala
People as resource Grade IX.pdf minimalaPeople as resource Grade IX.pdf minimala
People as resource Grade IX.pdf minimala
riddhimaagrawal986
 
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
ydzowc
 
ITSM Integration with MuleSoft.pptx
ITSM  Integration with MuleSoft.pptxITSM  Integration with MuleSoft.pptx
ITSM Integration with MuleSoft.pptx
VANDANAMOHANGOUDA
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
Atif Razi
 
Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
Nada Hikmah
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
Hitesh Mohapatra
 
Data Driven Maintenance | UReason Webinar
Data Driven Maintenance | UReason WebinarData Driven Maintenance | UReason Webinar
Data Driven Maintenance | UReason Webinar
UReason
 
integral complex analysis chapter 06 .pdf
integral complex analysis chapter 06 .pdfintegral complex analysis chapter 06 .pdf
integral complex analysis chapter 06 .pdf
gaafergoudaay7aga
 

Recently uploaded (20)

Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
 
Software Quality Assurance-se412-v11.ppt
Software Quality Assurance-se412-v11.pptSoftware Quality Assurance-se412-v11.ppt
Software Quality Assurance-se412-v11.ppt
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
 
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURSCompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
 
Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 
artificial intelligence and data science contents.pptx
artificial intelligence and data science contents.pptxartificial intelligence and data science contents.pptx
artificial intelligence and data science contents.pptx
 
cnn.pptx Convolutional neural network used for image classication
cnn.pptx Convolutional neural network used for image classicationcnn.pptx Convolutional neural network used for image classication
cnn.pptx Convolutional neural network used for image classication
 
Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
 
People as resource Grade IX.pdf minimala
People as resource Grade IX.pdf minimalaPeople as resource Grade IX.pdf minimala
People as resource Grade IX.pdf minimala
 
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
 
ITSM Integration with MuleSoft.pptx
ITSM  Integration with MuleSoft.pptxITSM  Integration with MuleSoft.pptx
ITSM Integration with MuleSoft.pptx
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
 
Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
 
Data Driven Maintenance | UReason Webinar
Data Driven Maintenance | UReason WebinarData Driven Maintenance | UReason Webinar
Data Driven Maintenance | UReason Webinar
 
integral complex analysis chapter 06 .pdf
integral complex analysis chapter 06 .pdfintegral complex analysis chapter 06 .pdf
integral complex analysis chapter 06 .pdf
 

HSpice Essential Examples

  • 1. HSPICE Essential Examples Dariush Naseh Shahid Beheshti University of Tehran
  • 2. Voltage Divider ** Voltage Divider ** R1 in out 1K R2 out 0 1k V1 in 0 DC 4V .OP .END R1 1k R2 1k V1 4v 0 outin Dariush Naseh - Shahid Beheshti University of Tehran 10/2/2016
  • 3. Subcircuit ** Subcircuit Voltage Divider** .SUBCKT BLK1 input output R1 input 1 1k R2 1 output 1K .ENDS X1 in out BLK1 X2 out 0 BLK1 V1 in 0 DC 4v .OP .END V1 4v BLK1 input output BLK1 inputoutput 0 Dariush Naseh - Shahid Beheshti University of Tehran 10/2/2016
  • 4. To Call a Subcircuit ** Call subcircuit ** .INCLUDE "z:Voltage Divider.sp" X1 in out BLK X2 out 0 BLK VDC in 0 DC 4V .OP .END Dariush Naseh - Shahid Beheshti University of Tehran 10/2/2016
  • 5. Switch tclose ** RC switch ** R1 2 3 1k C1 3 0 1u IC=0 V1 1 0 DC 1v G1 1 2 VCR PWL(1) 4 5 0 100MEG 1 0.1m V2 4 5 PWL 0 0 4.9999m 0 5m 1 .TRAN 1n 10m 0.01m .END R1 1k C1 1u IC = 0 U1 TCLOSE = 5m 1 2 V1 1v 0 1 32 Dariush Naseh - Shahid Beheshti University of Tehran 10/2/2016
  • 6. Other SW tclose & Creating Step Function ** RC Switch 1 ** I1 0 V1 PWL 0 0 0.0000001 1 C1 V1 0 1 IC=0 R1 V1 0 1 G1 V1 V2 VCR PWL(1) v4 0 0 100000meg 1 0.001m R2 V2 0 1 G2 V2 v3 VCR PWL(1) v5 0 0 100000meg 1 0.001m C2 V3 0 1 IC=0 V1 V4 0 PWL 0 0 10 0 10.000001 1 V2 V5 0 PWL 0 0 15 0 15.000001 1 .TRAN 10m 20 .END I1 1A C1 1 IC = 0 R1 1 U1 TCLOSE = 10s 1 2 R2 1 U2 TCLOSE = 15s 1 2 C2 1 IC = 0 0 V1 V2 V3 Dariush Naseh - Shahid Beheshti University of Tehran 10/2/2016
  • 7. Dariush Naseh - Shahid Beheshti University of Tehran 10/2/2016
  • 8. Pulse Generator .TITLE pulse wave Vin in 0 PULSE 1 -1 0 1n 1n 1m 2m R1 in out 1k C1 out 0 100n .TRAN 10u 10m .PROBE output=par('V(out)') .PROBE input=par('V(in)') .END C2 100n out R2 1k in V3 TD = 0 TF = 1n PW = 1m PER = 2m V1 = 1 TR = 1n V2 = -1 0 Dariush Naseh - Shahid Beheshti University of Tehran 10/2/2016
  • 9. Triangle Pulse Generator .TITLE triangle wave V1 in 0 PWL 0ms 0 5ms 15v 15ms -15 20ms 0 R1 in out 1k D1 A out d1n4734 D2 A 0 d1n4734 .MODEL d1N4734 D Is=1.085f Rs=.7945 N=1 Xti=3 Eg=1.11 Cjo=157p M=.2966 + Vj=.75 Fc=.5 Bv=5.6 Ibv=.37157 Nbv=.64726 .TRAN 20us 20ms .PROBE vin=par('v(in)') .PROBE Vout=par('v(out)') .END V1 R1 1k D1 D1N4734 D2 D1N4734 in A out 0 Dariush Naseh - Shahid Beheshti University of Tehran 10/2/2016
  • 10. Dependent Sources ** VCCS ** G1 0 1 VCCS 0 2 2 R1 1 2 1 I1 0 2 DC 1 R2 2 3 1 V1 3 0 DC 2 .OP .END V1 2v R1 1 R2 1 + - G1 GAIN = 2 I1 1A 0 0 1 32 0 2 Dariush Naseh - Shahid Beheshti University of Tehran 10/2/2016
  • 11. Dependent sourse , another Ex. (VCCS & CCVS) ** Other example in VCCS and CCCS ** I1 V1 V3 DC 1 R3 A V2 1 R1 V2 V3 1 R2 V3 0 1 R4 v1 V4 1 V1 V2 0 2 H1 V4 0 CCVS Vc 4 Vc V1 A DC 0 G1 V2 V4 VCCS V3 V2 2 .OP .END V1 2V + - G1 GAIN = 2 R1 1 R2 1 V3 I1 1AR3 1 V2 R4 1 V4 H1 GAIN = 4 0 V1 A V2 V3 Dariush Naseh - Shahid Beheshti University of Tehran 10/2/2016
  • 12. Ideal Transformer ** Rectifire with RC Filter ** E1 3 4 TRANSFORMER 1 2 10 Vin 1 2 SIN 0 318 50 0 0 0 D1 3 out d1n4007 D2 0 3 d1n4007 D3 4 out d1n4007 D4 0 4 d1n4007 .MODEL d1n4007 D IS=1.09774E-008 n=1.78309 Rs=0.0414388 + Eg=1.11 Xti=3 Cjo=2.8173E-011 Vj=0.50772 + m=0.318974 Fc=0.5 TT=9.85376E-006 Bv=1100 Ibv=0.1 Kf=0 R1 Out 0 1k C1 out 0 220u .TRAN 0.1m 1000m START=900m .PROBE IDiode=par('I(D1)') .PROBE Vtrans=par('V(3)-V(4)') .END V1 FREQ = 50Hz VAMPL = 318v TX1 D1 D1N4007 D2 D1N4007 D3 D1N4007 D4 D1N4007 R1 1k C1 220uF Out3 4 1 2 Dariush Naseh - Shahid Beheshti University of Tehran 10/2/2016
  • 13. Dariush Naseh - Shahid Beheshti University of Tehran 10/2/2016
  • 14. Linear mutual inductor .Title Linear mutual inductor R1 1 2 2 L1 2 0 8 L2 3 0 200 K1 L1 L2 1 R3 3 0 200 Vs 1 0 AC 50 0 .AC DEC 200 100 100k .PROBE vtarget=par('V(2)') .PROBE Phase=par('VP(2)') .END V1 50v ACPHASE = 0 R1 2 L1 8 L2 200 R2 200 0 1 2 3 K COUPLING= K1 COUPLING = 1 Dariush Naseh - Shahid Beheshti University of Tehran 10/2/2016
  • 15. Ideal Op-Amp .TITLE Ideal Op-Amp .INCLUDE "Z:7805.sp" Vi in 0 DC 15v x1 in 2 out LM7805 R1 3 0 1k R2 1 0 1k R3 out 1 2k E1 2 3 OPAMP 1 2 .TRAN 0.1m 10m .END V1 15v U1 OPAMP + - OUT R1 1k R2 1k R3 2k U2 LM7805C IN 1 OUT 2 GND 3 0 in out 1 2 0 0 3 Dariush Naseh - Shahid Beheshti University of Tehran 10/2/2016
  • 16. Identifying Rin & Rout & Av in OPAMP .TITLE op-amp V1 2 0 DC 1 V2 1 0 DC 100m R1 2 4 500 R2 1 3 5k R3 3 0 10k R4 4 3 100K **Rin=100k** R5 4 6 1k R6 5 6 1k ** Rout=1k** R7 6 0 1k E1 5 0 OPAMP 3 4 100K **Av=100K** .DC V1 LIN 499 1m 500m .PROBE Vout=par('v(6)') .END V1 1v V2 100m U1 OPAMP + - OUT 0 0 R1 500 R2 5k R3 10k 0 R5 1k R7 1k 0 6 31 42 Dariush Naseh - Shahid Beheshti University of Tehran 10/2/2016
  • 17. Plotting characteristic curve of Doid (source sweeping) ** characteristic curve of Diod ** R1 in out 1k D1 out 0 d1n4148 V1 in 0 DC 1v .MODEL d1n4148 D Is=2.682n N=1.836 Rs=.5664 Xti=3 Eg=1.11 Cjo=4p + M=.3333 Vj=.5 Fc=.5 Bv=100 Ibv=100u Tt=11.54n .DC V1 LIN 300 0 30 SWEEP TEMP LIN 2 25 50 .PROBE IDiode=par('I(D1)') .END D1 D1N4148 V1 1v R1 1k 0 outin Dariush Naseh - Shahid Beheshti University of Tehran 10/2/2016
  • 18. Maximum Power Transfer (elements sweeping) ** Maxium Power Transfer** .PARAM r=1 R1 in out r R2 out 0 10k V1 in 0 DC 10v .DC r LIN 400 8k 12k .PLOT P(R1) .END V1 10v R1 {r} 0 outin PARAMETERS: r = 1k R2 10k Dariush Naseh - Shahid Beheshti University of Tehran 10/2/2016
  • 19. Thevenin Equivqlent & IF-ELSE Structure .TITLE Thevenin equivqlent R1 1 2 1 R2 2 3 1 R3 2 4 1 VSENSE 4 0 DC 0 H1 3 0 CCVS VSENSE 0.5 .PARAM k=0 .IF(K==1) { Vin 1 0 DC 1v .TRAN 0.1m 10m .PROBE Rin=par('-V(1)/I(Vin)') } .ELSEIF(K==0) { Vin 1 0 DC 0 .TRAN 0.1m 10m .PROBE ISC=par('I(Vin)') } .ENDIF .END R1 1 R2 1 R3 1 H1 GAIN = 0.5 0 2 31 0 VSENSE 4 Dariush Naseh - Shahid Beheshti University of Tehran 10/2/2016
  • 20. .SENS Command Sensitivity of element’s variation .TITLE Self Bias Sensivity ro Vcc VCC VCC 0 DC 15v RB1 VCC B 3.9k RB2 B 0 1.5k RC VCC C 470 RE E 0 180 Q1 C B E BC107A .MODEL BC107A NPN Is=7.049f Xti=3 Eg=1.11 Vaf=116.3 Bf=375.5 Ise=7.049f + Ne=1.281 Ikf=4.589 Nk=.5 Xtb=1.5 Br=2.611 Isc=121.7p Nc=1.865 + Ikr=5.313 Rc=1.464 Cjc=5.38p Mjc=.329 Vjc=.6218 Fc=.5 Cje=11.5p + Mje=.2717 Vje=.5 Tr=10n Tf=451p Itf=6.194 Xtf=17.43 Vtf=10 .OP .SENS IC(Q1) .END VCC 15v Q1 BC107A RC 470 RB1 3.9k RE 180 RB2 1.5k 0 00 dc sensitivities of output ic(q1) element element element normalized name value sensitivity sensitivity (amps/unit) (amps/percent) 0:rb1 3.9000k -4.1551u -162.0503u 0:rb2 1.5000k 10.4832u 157.2486u 0:rc 470.0000 -101.2284n -475.7735n 0:re 180.0000 -99.2755u -178.6959u 0:vcc 15.0000 1.4890m 223.3519u Dariush Naseh - Shahid Beheshti University of Tehran 10/2/2016
  • 21. Sweeping the specifications of models .TITLE DC sweep .PARAM k=5.6 Vi in 0 1v R1 in out 1k D1 0 out d1n4734 .MODEL d1N4734 D Is=1.085f Rs=.7945 N=1 Xti=3 Eg=1.11 Cjo=157p + M=.2966 Vj=.75 Fc=.5 Bv=k Ibv=.37157 Nbv=.64726 .DC Vi LIN 300 -15 +15 SWEEP k LIN 6 1.6 6.6 .PROBE target=par('V(out)') .END D1 D1N4734 R1 1kV1 1v 0 outin Dariush Naseh - Shahid Beheshti University of Tehran 10/2/2016
  • 22. Output characteristic curve of BJT .TITLE Curve IDC 0 B DC 1m VDC C 0 DC 5V V1 E 0 DC 0 Q1 C B E BC107A .MODEL BC107A NPN Is=7.049f Xti=3 Eg=1.11 Vaf=116.3 Bf=375.5 Ise=7.049f + Ne=1.281 Ikf=4.589 Nk=.5 Xtb=1.5 Br=2.611 Isc=121.7p Nc=1.865 + Ikr=5.313 Rc=1.464 Cjc=5.38p Mjc=.329 Vjc=.6218 Fc=.5 Cje=11.5p + Mje=.2717 Vje=.5 Tr=10n Tf=451p Itf=6.194 Xtf=17.43 Vtf=10 .DC VDC LIN 200 0 20 SWEEP IDC LIN 5 0 40u .PROBE I=par('IC(Q1)') .END IDC 1m Q1 BC107A VDC 5v 00 0 Dariush Naseh - Shahid Beheshti University of Tehran 10/2/2016
  • 23. ICQ-B Curve in BJT .TITLE Beta IDC 0 B DC 1m VDC C 0 DC 5v V1 E 0 DC 0 Q1 C B E BC107A .MODEL BC107A NPN Is=7.049f Xti=3 Eg=1.11 Vaf=116.3 Bf=375.5 Ise=7.049f + Ne=1.281 Ikf=4.589 Nk=.5 Xtb=1.5 Br=2.611 Isc=121.7p Nc=1.865 + Ikr=5.313 Rc=1.464 Cjc=5.38p Mjc=.329 Vjc=.6218 Fc=.5 Cje=11.5p + Mje=.2717 Vje=.5 Tr=10n Tf=451p Itf=6.194 Xtf=17.43 Vtf=10 .DC IDC LIN 10000 1u 10m SWEEP VDC LIN 3 5 15 .PROBE Beta=par('IC(Q1)/IB(Q1)') .PROBE ICollector=par('(IC(Q1))') .END IDC 1m Q1 BC107A VDC 5v 00 0 Dariush Naseh - Shahid Beheshti University of Tehran 10/2/2016
  • 24. HFE & Transition Frequency of BJT ** HFE and transition frequency ** .PARAM k=1u VDC C 0 DC 5v IDC 0 B DC k AC 1 0 V1 E 0 DC 0 Q1 C B E BC107A .MODEL BC107A NPN Is=7.049f Xti=3 Eg=1.11 Vaf=116.3 Bf=375.5 Ise=7.049f + Ne=1.281 Ikf=4.589 Nk=.5 Xtb=1.5 Br=2.611 Isc=121.7p Nc=1.865 + Ikr=5.313 Rc=1.464 Cjc=5.38p Mjc=.329 Vjc=.6218 Fc=.5 Cje=11.5p + Mje=.2717 Vje=.5 Tr=10n Tf=451p Itf=6.194 Xtf=17.43 Vtf=10 .AC DEC 200 1 1G SWEEP K LIN 3 5u 15u .probe beta=par('IC(Q1)/IB(Q1)') .end IDC 1u Q1 BC107A VDC 5v 00 0 Dariush Naseh - Shahid Beheshti University of Tehran 10/2/2016
  • 25. Wien Bridge Oscillator .TITLE wien brigde oscillator .INCLUDE "Z:LM741.sp" Vcc Vcc 0 DC 12v Vee 0 Vee DC 12v X1 3 2 Vcc Vee 1 LM741 R1 5 2 18k R2 2 0 10k R3 3 4 1.6k R4 3 0 1.6k R5 1 5 4.7k C1 4 1 10n C2 3 0 10n D1 5 1 d1n4148 D2 1 5 d1n4148 I1 0 3 PWL 0 0 1us 1mA 4us 1mA 4.0001us 0 .MODEL d1n4148 D Is=2.682n N=1.836 Rs=.5664 Ikf=44.17m Xti=3 Eg=1.11 Cjo=4p + M=.3333 Vj=.5 Fc=.5 Isr=1.565n Nr=2 Bv=100 Ibv=100u Tt=11.54n .TRAN 1n 2m .PROBE vout=par('V(1)') .END U2 LM741/NS + 3 - 2 V+ 7 V- 4 OUT 6 OS2 5 OS1 1 R1 18k R2 10k R3 1.6k R4 1.6k C1 10n C2 10n 0 00 2 3 4 1 V1 12v V2 12v 0 Vcc Vee Vee Vcc R5 4.7k D1 D1N4148 D2 D1N4148 5 I1 0 Dariush Naseh - Shahid Beheshti University of Tehran 10/2/2016
  • 26. Power Amplifiers in B-Class and Fourier Analysis .TITLE Power amplifire in B-Class VCC VCC 0 12v Vee 0 Vee 12v Q1 Vcc B out BD135 Q2 Vee B out BD136 RL out 0 100 R1 in B 50 Vin in 0 Sin 0 8V 10KHz 0 0 0 .MODEL BD135 NPN IS = 4.815E-14 NF = 0.9897 ISE = 1.389E-14 NE = 1.6 BF = 124.2 + IKF = 1.6 VAF = 222 NR = 0.9895 ISC = 1.295E-13 NC = 1.183 + BR = 13.26 IKR = 0.29 VAR = 81.4 RB = 0.5 IRB = 1E-06 RBM = 0.5 + RE = 0.165 RC = 0.096 XTB = 0 EG = 1.11 XTI = 3 CJE = 1.243E-10 + VJE = 0.7313 MJE = 0.3476 TF = 6.478E-10 XTF = 29 VTF = 2.648 + ITF = 3.35 PTF = 0 CJC = 3.04E-11 VJC = 0.5642 MJC = 0.4371 + XCJC = 0.15 TR = 1E-32 CJS = 0 VJS = 0.75 MJS = 0.333 FC = 0.9359 .MODEL BD136 PNP IS = 7.401E-14 NF = 0.9938 ISE = 4.104E-16 NE = 1.054 BF = 336.5 + IKF = 0.1689 VAF = 22.47 NR = 0.9913 ISC = 1.290E-14 NC = 1.100 + BR = 13.91 IKR = 9.888E-2 VAR = 30.00 RB = 0.500 IRB = 1E-06 + RBM = 0.500 RE = 0.208 RC = 5.526E-02 XTB = 0 EG = 1.11 XTI = 3 + CJE = 1.066E-10 VJE = 0.6900 MJE = 0.3676 TF = 2.578E-10 XTF = 13.56 + VTF = 2.366 ITF = 1.3040 PTF = 0 CJC = 5.234E-11 VJC = 0.6431 + MJC = 0.4436 XCJC = 0.440 TR = 1E-25 CJS = 0 VJS = 0.75 MJS = 0.333 + FC = 0.990 .TRAN 0.1u 1m START=0.8m .PROBE output=par('v(out)') .FOUR 10k v(out) .END Q1 BD135 Q2 BD136 Vcc 12 Vee 12RL 100 R1 50 B Vcc Vee 0 out Vee Vcc 0 V3 FREQ = 10k VAMPL = 8v VOFF = 0 0 in Dariush Naseh - Shahid Beheshti University of Tehran 10/2/2016
  • 27. Dariush Naseh - Shahid Beheshti University of Tehran 10/2/2016
  • 28. .MEASURE Command (Calculation of output DC Level) .TLTEL CE VCC VCC 0 DC 12v RB1 VCC B 100K RB2 B 0 27k RC VCC C 4.7k RE1 E 1 47 RE2 1 0 3.9k RS in 2 50 CB 1 0 470u CC 2 B 10u Q1 C B E BC107A .MODEL BC107A NPN Is=7.049f Xti=3 Eg=1.11 Vaf=116.3 Bf=375.5 Ise=7.049f + Ne=1.281 Ikf=4.589 Nk=.5 Xtb=1.5 Br=2.611 Isc=121.7p Nc=1.865 + Ikr=5.313 Rc=1.464 Cjc=5.38p Mjc=.329 Vjc=.6218 Fc=.5 Cje=11.5p + Mje=.2717 Vje=.5 Tr=10n Tf=451p Itf=6.194 Xtf=17.43 Vtf=10 Vin in 0 0 AC 1 Sin 0 5mV 10kHz .op .AC DEC 200 1 100MEG .TRAN 0.1us 1ms .PROBE AC Gain=par('VDB(c)') .PROBE AC Phase=par('-ABS(VP(c))') .MEASURE TRAN val avg v(c) from=0 to=0.1ms .PROBE TRAN output=par('V(c)-val') .PROBE AC Rin=par('V(in)/I(Rs)') .END VCC 12vRC 4.7k RB1 4.7k RB2 27k RE1 47 Q1 BC107A RE2 3.9k RS 50 C1 10u V2 FREQ = 10k VAMPL = 5m VOFF = 0 AC = 1 00 B C2 470u 0 1 0in 2 Vcc 0 Dariush Naseh - Shahid Beheshti University of Tehran 10/2/2016
  • 29. Dariush Naseh - Shahid Beheshti University of Tehran 10/2/2016
  • 30. Example of .MEASURE Command WHEN-FIND TITLE measure Vin in 0 PWL 0 0 1ns 1v 10ms 1 10.0000001m 0 R1 in out 1k C1 out 0 1u .TRAN 20u 20ms .MEASURE TRAN val1 FIND I(R1) AT=1m .MEASURE TRAN Val2 WHEN V(out)='0.5' CROSS=2 .PROBE input=par('V(in)') .PROBE output=par('V(out)') .END R1 1k C1 1u 0 V1 outin Dariush Naseh - Shahid Beheshti University of Tehran 10/2/2016
  • 31. Square wave, MEASURMET of RISE TIME (MIN,MAX,PP &TRIG… TARG… ) .TITLE Rise Time Vi in 0 PULSE 1 -1 0 1p 1p 1m 2m R1 in out 1k C1 out 0 100n .TRAN 0.1u 10m .MEASURE MAX MAX V(out) FROM=6.1m TO=8m .MEASURE MIN MIN V(out) FROM=6.1m To=8m .MEASURE PP PP V(out) FROM=6.1m TO=8m .MEASURE TRAN T1 TRIG V(in) val=1 TD=6.1ms RISE=1 TARG V(out) val=0.1*PP+MIN TD=6.1ms RISE=1 .MEASURE TRAN T2 TRIG V(in) val=1 TD=6.1ms RISE=1 TARG V(out) val=0.9*PP+MIN TD=6.1ms RISE=1 .MEASURE TRAN Tr=param'T2-T1' .PROBE in=par('v(in)') .PROBE OUT=par('V(out)') .END Dariush Naseh - Shahid Beheshti University of Tehran 10/2/2016
  • 32. .PZ Command Pole & Zero .TITLE Pole and zero V1 in 0 DC 0 AC 1 R1 in out 1k C1 out 0 100n .AC DEC 200 1 100k .PROBE gain=par('VDB(out)') .PROBE pahse=par('VP(out)') .PZ v(out) v1 .END V2 1Vac 0Vdc out 0 R1 1k C1 100n in Dariush Naseh - Shahid Beheshti University of Tehran 10/2/2016
  • 33. .TF Command (Transfer Function) .TITLE Diffrentional Amplifire VCC VCC 0 12v VEE 0 VEE 12v V1 in 0 DC 0 Q1 1 1 VCC BC177 Q2 2 1 VCC BC177 Q3 1 in 3 BC107A Q4 2 0 3 BC107A Q5 3 4 6 BC107A R1 4 VEE 1.8k R2 4 0 22k R3 6 VEE 100 .MODEL BC107A NPN Is=7.049f Xti=3 Eg=1.11 Vaf=116.3 Bf=375.5 Ise=7.049f + Ne=1.281 Ikf=4.589 Nk=.5 Xtb=1.5 Br=2.611 Isc=121.7p Nc=1.865 + Ikr=5.313 Rc=1.464 Cjc=5.38p Mjc=.329 Vjc=.6218 Fc=.5 Cje=11.5p + Mje=.2717 Vje=.5 Tr=10n Tf=451p Itf=6.194 Xtf=17.43 Vtf=10 .MODEL BC177 PNP Is=336.7f Xti=3 Eg=1.11 Vaf=55.46 Bf=154.4 Ise=412.1f + Ne=1.429 Ikf=.2994 Nk=.7028 Xtb=1.5 Br=3.99 Isc=1.03n Nc=1.958 + Ikr=9.726 Rc=1.833 Cjc=11p Mjc=.2223 Vjc=.5 Fc=.5 Cje=33p + Mje=.3333 Vje=.5 Tr=10n Tf=847.7p Itf=2.198 Xtf=23.26 Vtf=10 .OP .TF v(2) v1 .END Q1 BC177 Q2 BC177 Q3 BC107A Q4 BC107A Q5 BC107A V1 12 V2 12 VEE VCC R1 100 R2 1.8k R3 22k VEE 0 VCC 0 V3VAC=1 VDC=0 0 Vin Dariush Naseh - Shahid Beheshti University of Tehran 10/2/2016
  • 34. LAPLACE Transform Simulation TITLE LAPLACE ERC 2 0 LAPLACE 1 0 1/1,1E-3 Vin 1 0 DC 0 AC 1 sin 0 1 159 .AC DEC 200 0.1 100MEG .TRAN 0.6u 60m .PROBE TRAN out=par('V(2)') .PROBE AC ampel=par('VDB(2)') .PROBE AC phase=par('VP(2)') .MEASURE AC MAX FIND VDB(2) AT=1 .MEASURE AC cutoff WHEN vDB(2)='MAX-3' .END V2 R1 1k 0 C1 1u Dariush Naseh - Shahid Beheshti University of Tehran 10/2/2016