Debian Codegraph @

texmf-dist/doc/latex/circuit-macros/examples/ex12.m4

raw
1 .PS
2 # ex12.m4
3 cct_init
4
5 [
6 fetht = dimen_*0.9
7
8 G: ground
9 Q4: e_fet(up_ fetht) with .S at G
10 Q3: e_fet(up_ fetht) with .S at Q4.D
11
12 Q2: e_fet(down_ fetht,R,P) with .G at Q3.Channel+( dimen_*0.25,dimen_*1.8)
13 Q1: e_fet(down_ fetht,R,P) with .G at Q2.G + (-dimen_*1.25,0)
14
15 line left_ dimen_ from Q3.G
16 A: dot; "$A$sp_" rjust
17 line left_ dimen_ from Q4.G
18 B: dot; "$B$sp_" rjust
19
20 line from Q1.G to (Q1.G,Q3.D) then to (Q1.Channel,Q3.D) \
21 then to (Q1.Channel,B);dot
22 line from Q2.G to (Q3.Channel,Q2.G) then to (Q3.Channel,Q3.D) \
23 then to (Q3.G,Q3.D) then to Q3.G;dot
24 line from Q1.D to Q2.D
25 line from Q1.S to Q2.S
26 dot(at (G,Q1.S)) ; line up dimen_/3 ; "$+5$V{}sp_" rjust
27 line from Q3.D to (Q3.D,Q2.D);dot
28 dot(at Q3.D)
29 line right_ dimen_ ; dot ; "sp_$\overline{AB}$" above
30 ]
31
32 [
33 del = dimen_/3
34
35 define(`pair',`[
36 Q1: c_fet(up_ dimen_,,P)
37 line right dimen_*2/3 from Q1.D
38 {dot(at last line.c); reversed(`source',up_ dimen_,I); Rail: Here
39 line right dimen_/2 with .c at Here}
40 Q2: c_fet(up_ dimen_,R,P) with .D at Here
41 line down del*2 from Q2.S
42 resistor(down_ dimen_)
43 Gnd: ground(,T,S)
44 ]')
45
46 P1: pair
47 Rail: P1.Rail
48 Vc: dot(at P1.Q2.S+(0,-del)); "$V_{\hbox{\small c}}$" rjust
49 line from P1.Q1.G to (P1.Q1.G,Rail)+(0,del/2); "$S{+}$" ljust
50
51 line right_ del from P1.Q2.G
52 {dot(at last line.c); line up del; "$V_{\hbox{\small ref}}$" above}
53 pht = P1.Rail.y-P1.Gnd.y
54
55 P2: pair with .Q1.G at Here
56 Vcp: dot(at P2.Q2.S+(0,-del*2)); {"$V_{\hbox{\small c$'$}}$" above rjust}
57 {line to (P1.Q1.S,Here) then to P1.Q1.S}
58 line from P2.Q2.G to (P2.Q2.G,Rail)+(0,del/2); "$S{-}$" rjust
59
60 line from Vc to (P2.Q1.S,Vc) then to P2.Q1.S
61
62 define(`cpair',`[
63 Rail: line right dimen_/2
64 Q1: c_fet(up_ dimen_,,P) with .D at last line.c
65 Q2: c_fet(up_ dimen_) with .S at Rail.c+(0,-pht)
66 ground(at Q2.S,T,S)
67 line from Q1.G to Q2.G
68 line from Q1.S to Q2.D
69 ]')
70
71 S1: cpair with .Rail at P2.Rail+(P2.Q2.G.x-P2.Rail.x+P2.Q2.G.x-P2.Q2.D.x+del,0)
72 S2: cpair with .Q1.G at (S1.Q1.D.x+del,S1.Q1.G.y)
73 S3: cpair with .Rail at 2 between S1.Rail and S2.Rail
74
75 line from Vcp to (S2.Q2.G,Vcp); dot
76 dot(at (S2.Q2.D,Here)); line to (S3.Q2.G,Here); dot
77 dot(at (S3.Q2.D,Here)); arrow right del; "$e_2$" ljust
78 dot(at P2.Q1.S); line to (S1.Q1.G,Here); dot
79 dot(at (S1.Q2.D,Here)); arrow to (last arrow.end,Here); "$e_1$" ljust
80
81
82 ] with .sw at last [].se+(0.25,0)
83
84 [
85 elen=0.2
86
87 VDD: dot; llabel(,V_{DD},)
88 line down_ elen/2
89 P1: mosfet(up_,,ZSDFdTX,) with .D at Here
90
91 MIDDLE: line from P1.S down_ elen/2
92
93 N1: mosfet(up_,,ZSDFTX,) with .D at Here
94 N2: mosfet(up_,,ZSDFTX,) with .D at N1.S
95 ground(at N2.S)
96
97 ING: P1.G+(-elen/2,0)
98
99 line from P1.B right_ elen * 2/5 then down_ elen * 4/5
100 line to (ING, Here)
101 dot
102
103 line from N1.B right_ elen * 2/5 then up_ elen * 4/5
104 line to (ING, Here)
105 dot
106
107 line from N1.G to (ING,N1.G)
108 dot
109
110 line from N2.G to (ING,N2.G) then to ING then to P1.G
111
112 dot(at (ING,MIDDLE))
113 line left_ elen*2
114 "$V_{\hbox{\scriptsize in}}$" above
115
116 dot(at MIDDLE)
117 line right_ elen*2
118 { "$V_{\hbox{\scriptsize out}}$" above }
119
120 line from N2.B to (Here,N2.B)
121 "$V_{BB}$" above
122
123 PUNT:dot(at 0.5 between N1.S and N2.D)
124
125 "$V_x$" ljust
126
127 "$P_1$" at P1.Channel.end above rjust
128 "$N_1$" at N1.Channel.start below rjust
129 "$N_2$" at N2.Channel.start below rjust
130
131 ] with .sw at last [].se
132
133 .PE