Debian Codegraph @

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

raw
1 .PS
2 # lcctDPV.m4
3 maxpswid = 10
4 log_init(svg_font(sans-serif,11bp__,2bp__))
5 include(icsDPV.m4)
6
7 textht = textht * 0.9
8
9 define(`dimen_',0.5)
10 define(`elen_',dimen_)
11 define(`Groundtype',`')
12
13 define(`breakout',` for i = 1 to `$1' do {
14 {line `$2' ifelse(`$4',,del,`$4')-jog/2 then `$2' jog/2 `$3' jog \
15 then `$3' lg_pinsep}
16 move `$3' lg_pinsep }
17 move `$2' ifelse(`$4',,del,`$4')-jog/2 then `$2' jog/2 `$3' jog ')
18
19 del = lg_pinsep
20 jog = del*2/3
21
22 right_
23 IC1: ic6502("6502" at Chip.sw+(0,-2bp__) below ljust) \
24
25 Vcc: IC1.Pin8.end.x-del-elen_,IC1.Pin4.y+lg_pinsep+3*del
26 Reset: IC1.Pin8.end.x-del,Vcc.y+del
27
28 resistor(up_ Vcc.y-IC1.Pin4.y from IC1.Pin4.end)
29
30 line left 2*del from IC1.Pin6.end
31 line up_ to (Here,Vcc) chop 0 chop elen_
32 resistor
33
34 line left del from IC1.Pin40.end
35 {line to (Here,Reset)}
36 move left elen_
37 {NOT_gate(right_ elen_)}
38 {reversed(`capacitor',to (Here,Vcc),C)}
39 down_; resistor; ground(,T,Groundtype)
40
41 line from IC1.Pin2.end to (IC1.Pin2.end,Vcc)
42
43 move to IC1.Pin26.end; breakout(8,left,down)
44 line to (Here,IC1.sw+(0,-del))
45 line down jog right jog/2
46 Data: Here
47
48 line from IC1.Pin1.end down_ 2*lg_pinsep; ground(,T,Groundtype)
49
50 line left 2*del from IC1.Pin34.end
51 line to (Here,Data+(0,-del))
52 RWB: Here
53
54 move to IC1.Pin25.end; breakout(16,right,down)
55 line to (Here,RWB)+(0,-del+jog) then down jog left jog/2
56 Addr: Here
57
58 right_
59 IC5: ic74LS138("74LS138" at Chip.sw+(0,-2bp__) below ljust) \
60 with .Chip.nw at (IC1.Chip.w.x,Addr.y-2*del)
61 line from IC5.Pin5.end down_ 3*lg_pinsep ; ground(,T,Groundtype)
62 line from IC5.Pin16.end down_ 1.5*lg_pinsep ; ground(,T,Groundtype)
63 move to IC5.Pin1.end; breakout(3,left,up)
64 line to Here.x,Addr.y-jog then up jog right jog/2 then to Addr
65
66 line right_ 2*del from IC1.Pin39.end
67 { NOT_gate(right_ 3*del)
68 C1: Here }
69 capacitor(up_ elen_*0.6)
70 {resistor(right_ 3*del)}
71 line up 2*(IC1.Pin37.y-Here.y)
72 {line from IC1.Pin37.end to (Here,IC1.Pin37)}
73 right_; xtal(right_ 3*del)
74
75 IC2: ic6116("6116" at Chip.sw+(0,-2bp__) below ljust) \
76 with .Chip.nw at Here.x+2*del+lg_plen*L_unit,IC1.Chip.n.y
77 line from IC2.Pin24.end up to (IC2.Pin24.end,Vcc)
78 right_
79 Or1: OR_gate with .Out at IC2.Pin21.end
80 line from Or1.In2 left del then down del
81 line to (C1,Here) then to C1
82 line from Or1.In1 left del
83 line to (Here,IC2.Chip.nw+(0,del))
84 RW: Here
85 move to IC2.Pin17.end; breakout(8,left,down)
86 line to (Here,Data)+(0,jog) then down jog left jog/2
87 line down_ lg_pinsep from IC2.Pin12.end ; ground(,T,Groundtype)
88 move to IC2.Pin19.end; breakout(11,right,down)
89 line to (Here,Addr) chop 0 chop jog
90 line down jog left jog/2
91 line down_ lg_pinsep from IC2.Pin20.end ; ground(,T,Groundtype)
92
93 right_
94 IC3: ic6116("6116" at Chip.sw+(0,-2bp__) below ljust) \
95 with .Chip.nw at IC2.Chip.ne + (IC2.Chip.nw.x - IC1.Chip.ne.x-del,0)
96 IC4: ic6522("6522" at Chip.sw+(0,-2bp__) below ljust) \
97 with .Chip.nw at IC3.Chip.ne + (IC2.Chip.nw.x - IC1.Chip.ne.x-del,0)
98 IC6: ic74LS138("74LS138" at Chip.sw+(0,-2bp__) below ljust) \
99 with .Chip.nw at (IC3.Chip.nw,IC5.Chip.nw)
100
101 line from Vcc to (IC4.Pin34.end.x+del,Vcc.y)
102 line from Reset to (IC4.Pin34.end,Reset) then to IC4.Pin34.end
103
104 line right_ 2*del from (C1,IC4.Pin25); NOT_gate; line to IC4.Pin25.end
105 line right del from IC1.Pin4.end; line to Here.x,Vcc.y-del
106 line to (IC4.Pin21.end,Here)-(del,0) then to IC4.Pin21.end-(del,0) \
107 then to IC4.Pin21.end
108
109 line from IC3.Pin21.end to (IC3.Pin21.end,Vcc)
110 move to IC3.Pin17.end
111 breakout(8,left,down); line to (Here,Data)+(0,jog) then down jog left jog/2
112 move to IC3.Pin19.end
113 breakout(11,right,down); line to (Here,Addr)+(0,jog) then down jog left jog/2
114 move to IC4.Pin26.end
115 breakout(8,left,down,2*del);
116 line to (Here,Data)+(0,jog) then down jog left jog/2 then to Data
117 move to IC4.Pin35.end
118 breakout(4,left,down); line to (Here,Addr)+(0,jog) then down jog left jog/2 \
119 then to Addr
120 line from IC4.Pin20.end to (IC4.Pin20.end,Vcc)
121 line down_ lg_pinsep from IC4.Pin1.end; ground(,T,Groundtype)
122 line left 3*del from IC4.Pin23.end
123 line to (Here,IC6.Pin7) then to IC6.Pin7.end
124 line down_ 2*lg_pinsep from IC3.Pin18.end; ground(,T,Groundtype)
125
126 line down_ lg_pinsep from IC6.Pin8.end; ground(,T,Groundtype)
127 line up_ 2.5*lg_pinsep from IC6.Pin16.end \
128 then right_ lg_pinsep then down_ lg_pinsep/2; ground(,T,Groundtype)
129 move to IC6.Pin5.end; breakout(1,left,up); line up_ lg_pinsep
130 move to IC6.Pin1.end; breakout(3,left,up)
131 line to (Here,Addr)-(0,jog) then up jog left jog/2
132
133 line from RW to (IC3.Pin19.end+(2*del,0),RW)
134 RWE: Here
135 line to (RWE,RWB) then to RWB
136 line from IC4.Pin22.end to (RWE,IC4.Pin22.end)
137
138 right_
139 Or3: OR_gate with .Out at IC3.Pin20.end.x-del,IC1.Pin9.y
140 line from Or3.Out to (IC3.Pin20.end,Or3.Out) then to IC3.Pin20.end
141 left_
142 Or2: OR_gate with .In2 at (IC2.Chip.se,Or3.In1)
143 line from Or2.Out to (IC2.Pin18.end-(3*del,0),Or2.Out)
144 line to (Here,IC2.Pin18) then to IC2.Pin18.end
145 line from Or2.In1 right del; line to (Here,IC1.Pin37)
146
147 line from Or3.In2 left del; line to (Here,IC1.Pin37)
148
149 define(`addrlabel',`dnl
150 line invis right 4*del from IC5.Pin`$1'.end "svg_small(`$2')" above ')
151
152 addrlabel( 7,E000 - FFFF)
153 addrlabel( 9,C000 - DFFF)
154 addrlabel(10,A000 - BFFF)
155 addrlabel(11,8000 - 9FFF)
156 addrlabel(12,6000 - 7FFF)
157 addrlabel(13,4000 - 5FFF)
158 addrlabel(14,2000 - 3FFF)
159 addrlabel(15,0000 - 1FFF)
160
161 line from IC5.Pin7.end right 4*del
162 K: Here; line to (K,IC5.Pin13)
163 line to (IC6.Pin4.end-(3*del,0),Here)
164 line to (Here,IC6.Pin4.end) then to IC6.Pin4.end
165
166 Ands: [ right_
167 And1: AND_gate; line right del/2 then down del*3/2 \
168 then left And1.Out.x-And1.In1.x+del then down del then right_ del/2
169 And2: AND_gate with .In1 at Here
170 line from And2.Out right del/2 then down del then right_ del/2
171 And3: AND_gate with .In1 at Here
172 line right_ del/2 from And3.Out
173 NOT_gate
174 line right_ del/2
175 And4: AND_gate with .In1 at Here
176 ] with .And2.In1 at (K.x+2*del,IC5.Pin9.y)
177
178 # line from Ands.And4.Out right del*3; line to (Here,Or3.In1) then to Or3.In1
179 line from Ands.And4.Out right IC6.Pin5.end.x-3*del-Ands.And4.Out.x
180 line to (Here,Or3.In1) then to Or3.In1
181 line from Ands.And4.In2 left del
182 line to (Here,IC5.Pin14) then to IC5.Pin14.end
183 line from IC5.Pin15.end to (IC2.Pin20.end.x+2*del,IC5.Pin15.y)
184 line to (Here,Or2.In2) then to Or2.In2
185 NOT_gate(right_ from (K,Ands.And3.In2) to Ands.And3.In2)
186 line from Ands.And2.In2 to (K+(del+jog/2,0),Ands.And2.In2)
187 line left jog/2 up jog; line to (Here.x,Addr.y-jog) then up jog left jog/2
188 line from Ands.And1.In1 to (K.x+del+jog/2,Ands.And1.In1.y) \
189 then left jog/2 up jog
190 line from Ands.And1.In2 to (K.x+del+jog/2,Ands.And1.In2.y) \
191 then left jog/2 up jog
192
193 line from IC6.Pin6.end left 2*del; line to (Here,IC4.Pin24)
194 line from IC4.Pin24.end to (IC2.Chip.se,IC4.Pin24)
195 move left dimen_; {NOT_gate(right_ dimen_)}
196 line left jog/2 down jog; line to (Here,Data) chop 0 chop jog
197 line down jog left jog/2
198
199 command "</g>" # end font
200 .PE