summaryrefslogtreecommitdiff
path: root/graphics/circuit_macros/examples/MosfetElements.m4
blob: b8786e20e8b6e2a24e056923d4f53e8ff52ccc18 (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
73
74
75
76
77
78
.PS
# MosfetElements.m4
cct_init
s_init(MosfetElements)

  linewid = linewid*1.5
  linethick = 1.5

define(`mfgrid',
 `tr_xy_init(,m4_U,m4R)define(`m4R',)
  ltt = linethick; linethick = 0.4
  m4gdim = ifelse(`$1',,4,`($1)')
  iflatex(`latexcommand(\color{lightgray})')
  for x=-m4gdim to m4gdim do {
    line color "lightgray" from tr_xy(x,0) to tr_xy(x,2*m4gdim)
    if pmod(x,2)==0 then { sprintf("{\tiny %g}",x) at last line.start below }}
  for y=0 to 2*m4gdim do {
    line color "lightgray" from tr_xy(-m4gdim,y) to tr_xy(m4gdim,y)
    if pmod(y,2)==0 then { sprintf("{\tiny %g}",y) at last line.start rjust }}
  linethick = ltt
  iflatex(`latexcommand(\color{black})')
  Grid: box invis wid 2*m4gdim*m4_xyU ht 2*m4gdim*m4_xyU \
    with .sw at tr_xy(-m4gdim,0)
')
define(`gridnext',`with .Grid.w at last [].Grid.e + (m4_xyU*2,0)')
define(`gridbelow',`with .Grid.nw at `$1'.Grid.sw+(0,-linewid/2)')
define(`Gmosfet',`mfgrid; Q: mosfet(,,`$1') with .S at Grid.sw + (2*m4_xyU,0)')

R1: [ Gmosfet(B); "B" at Q.Bl ljust ]
 [ Gmosfet(D); "D" at Q.Dl ljust ] gridnext
 [ Gmosfet(E); "E" at Q.Channel below ] gridnext
 [ Gmosfet(F); "F" at Q.Channel below ] gridnext
 [ Gmosfet(G); "G" at Q.Gl ljust ] gridnext
 [ Gmosfet(H); "H" at Q.Hl ljust ] gridnext
 [ Gmosfet(L); "L" at Q.Ll ] gridnext
 [ Gmosfet(M); "M" at Q.Glh below ] gridnext

R2:[ Gmosfet(uM); "uM" at Q.Gl ] gridbelow(R1)
 [ Gmosfet(dM); "dM" at Q.Gl ] gridnext
 [ Gmosfet(Pz); "Pz" at Grid.s ] gridnext
 [ Gmosfet(Q); "Q" at Q.Ql above ] gridnext
 [ Gmosfet(R); "R" at Q.Rl below ] gridnext
 [ Gmosfet(S); "S" at Q.Sl ljust ] gridnext
 [ Gmosfet(dT); "dT" at Q.Tl below ] gridnext
 [ Gmosfet(X); "X" at Q.Xh above ] gridnext

R3:[ Gmosfet(uM1)
     "uM1" at Grid.s above
     "G0" at Q.G0 above
     "G1" at Q.G1 above ] gridbelow(R2)
 [ Gmosfet(dM1)
   "G0" at Q.G0 above
   "G1" at Q.G1 above
   "dM1" at Grid.s above ] gridnext

# [       Q: mosfet
#    {"S" at Q.S rjust}
#    {"D" at Q.D ljust}
#    {"G" at Q.G rjust}
#    s_box(``mosfet'') at Q.s below] 
#
# [       Q: mosfet(,,DSELuBQ)
#    s_box(``mosfet(,,DSELuBQ)'') at Q.s below] with .n at last [].s + (0,-0.2) 
#
# [       Q: mosfet(,,DSEMuBQ)
#    s_box(``mosfet(,,DSEMuBQ)'') at Q.s below] with .n at last [].s + (0,-0.2) 
#
# [       Q: mosfet(,,DSEdMuBQ)
#    s_box(``mosfet(,,DSEdMuBQ)'') at Q.s below] with .n at last [].s + (0,-0.2) 
#
# [       Q: mosfet(right dimen_,,DSELuBQN)
#    {"S" at Q.S rjust}
#    {"D" at Q.D ljust}
#    {"G" at Q.G rjust}
#    s_box(``mosfet(right dimen\_,,DSELuBQN)'') at Q.s below] \
#      with .n at last [].s + (0,-0.2) 

.PE