summaryrefslogtreecommitdiff
path: root/Windows/spice/examples/p-to-n-examples/switch-invs.lib
blob: 4a1eaaf26e962b644a73f4ac8ac6d2d3952a32a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
* sw like an NMOS inverter with resistive load
.subckt invertern In Out VDD DGND
*sp out vdd in vdd swswitch on
Rl out vdd 10k
Cl out dgnd 0.1p
*C2 out vdd 0.1p
sn out dgnd in dgnd swswitch off
.ends invertern

* sw like a PMOS inverter with resistive load
.subckt inverterp In Out VDD DGND
sp out vdd vdd in swswitch
Rl out 0 10k
*Cl out dgnd 0.1p
C2 out vdd 0.1p
*sn out dgnd in dgnd swswitch off
.ends inverterp

* sw like a CMOS inverter
.subckt inverter In Out VDD DGND
sp out vdd vdd in swswitch
Rin in 0 1e9
Cl out dgnd 0.1p
C2 out vdd 0.1p
sn out dgnd in dgnd swswitch
.ends inverter

.model swswitch sw (vt=1 vh=0.1 ron=1k roff=1e12)
.model switchn sw (vt=1 vh=0.1 ron=1k roff=1e12)

* sw like a CMOS inverter with PSPICE VSWITCH
.subckt invertervs In Out VDD DGND
sp out vdd vdd in swn
Rin in 0 1e9
Cl out dgnd 0.1p
C2 out vdd 0.1p
sn out dgnd in dgnd swn
.ends invertervs

.MODEL SWN VSWITCH ( VON = 1.1 VOFF = 0.9 RON=1k  ROFF=1e12 )


* sw like a CMOS inverter with PSPICE VSWITCH
.subckt invertervs2 In Out VDD DGND
sp out vdd vdd in swn
Rin in 0 1e9
Cl out dgnd 0.1p
C2 out vdd 0.1p
sn out dgnd in dgnd swn
.MODEL SWN VSWITCH ( VON = 1.1 VOFF = 0.9 RON=1k  ROFF=1e12 )
.ends invertervs2

* sw like a CMOS inverter with PSPICE VSWITCH
.subckt invertervs3 In Out VDD DGND
sp out vdd vdd in swn2
Rin in 0 1e9
Cl out dgnd 0.1p
C2 out vdd 0.1p
sn out dgnd in dgnd swn2
.ends invertervs3

.MODEL SWN2 VSWITCH ( VON = 1.1 VOFF = 0.9 RON=1k  ROFF=1e12 )

* sw like a CMOS inverter with PSPICE VSWITCH
.subckt invertervs4 In Out VDD DGND
sp out vdd vdd in swn
Rin in 0 1e9
Cl out dgnd 0.1p
C2 out vdd 0.1p
sn out dgnd in dgnd swn
.MODEL SWN VSWITCH ( VON = 1.1 VOFF = 0.9 RON=2k  ROFF=1e12 )
.ends invertervs4