Debian Codegraph @

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

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