Debian Codegraph @

texmf-dist/doc/latex/circuit-macros/examples/dpv/ex12DPV.m4

raw
1 .PS
2 # ex12.m4
3 cct_init(svg_font(sans-serif,11bp__))
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; "svg_it(A)" wid 0.15 rjust
17 line left_ dimen_ from Q4.G
18 B: dot; "svg_it(B)" 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" rjust
27 line from Q3.D to (Q3.D,Q2.D);dot
28 dot(at Q3.D)
29 line right_ dimen_ ; dot ; "svg_it(~(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)); "svg_it(V`'svg_sub(c))" rjust
49 line from P1.Q1.G to (P1.Q1.G,Rail)+(0,del/2); "svg_it(S+)" ljust
50
51 line right_ del from P1.Q2.G
52 {dot(at last line.c); line up del; "svg_it(V`'svg_sub(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)); {"svg_it(V`'svg_sub(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); "svg_it(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+(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
78 "svg_it(e`'svg_sub(2))" ljust
79 dot(at P2.Q1.S); line to (S1.Q1.G,Here); dot
80 dot(at (S1.Q2.D,Here)); arrow to (last arrow.end,Here)
81 "svg_it(e`'svg_sub(1))" ljust
82
83
84 ] with .sw at last [].se+(0.25,0)
85
86 [
87 elen=0.2
88
89 VDD: dot; llabel(,V`'svg_sub(DD),)
90 line down_ elen/2
91 P1: mosfet(up_,,ZSDFdTX,) with .D at Here
92
93 MIDDLE: line from P1.S down_ elen/2
94
95 N1: mosfet(up_,,ZSDFTX,) with .D at Here
96 N2: mosfet(up_,,ZSDFTX,) with .D at N1.S
97 ground(at N2.S)
98
99 ING: P1.G+(-elen/2,0)
100
101 line from P1.B right_ elen * 2/5 then down_ elen * 4/5
102 line to (ING, Here)
103 dot
104
105 line from N1.B right_ elen * 2/5 then up_ elen * 4/5
106 line to (ING, Here)
107 dot
108
109 line from N1.G to (ING,N1.G)
110 dot
111
112 line from N2.G to (ING,N2.G) then to ING then to P1.G
113
114 dot(at (ING,MIDDLE))
115 line left_ elen*2
116 "svg_it(V`'svg_sub(in))" above
117
118 dot(at MIDDLE)
119 line right_ elen*2
120 { "svg_it(V`'svg_sub(out))" wid 0.25 above }
121
122 line from N2.B to (Here,N2.B)
123 "svg_it(V`'svg_sub(BB))" above
124
125 PUNT:dot(at 0.5 between N1.S and N2.D)
126
127 "svg_it(V`'svg_sub(x))" ljust
128
129 "svg_it(P`'svg_sub(1))" at P1.Channel.end above rjust
130 "svg_it(N`'svg_sub(1))" at N1.Channel.start below rjust
131 "svg_it(N`'svg_sub(2))" at N2.Channel.start below rjust
132
133 ] with .sw at last [].se
134
135 command "</g>" # end font
136 .PE