summaryrefslogtreecommitdiff
path: root/graphics/circuit_macros/examples/nsvg/dev/test.pic
blob: d035baa113d070b5d223b1f16f0ffbbbcb2d769e (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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
.PS
# ex08.m4
# log_init Version 9.3: TikZ PGF m4 macro settings.
  
# log_init begin
  # gen_init Version 9.3: TikZ PGF m4 macro settings.
  

  define rpoint__ {
    rp_wid = last line.end.x-last line.start.x
    rp_ht = last line.end.y-last line.start.y
    rp_len = sqrt(abs((rp_wid)^2+(rp_ht)^2)); move to last line.start
    rp_ang = atan2(rp_ht,rp_wid) }

  rtod_ = 57.295779513082323;  dtor_ = 0.017453292519943295
  twopi_ = 6.2831853071795862;  pi_ = (twopi_/2)
  rp_ang = 0;  right
  
  
  linethick = 0.8
  arrowwid = 0.05*scale; arrowht = 0.1*scale 
  
  
  # gen_init end


# log_init end




# Input labels
C: (0,0); "\sf C " rjust at C
DE: C+(0,((linewid/10))*((2*3)*7/4))
A0: DE+(0,((linewid/10))*(4*3/2)); "\sf A0 " rjust at A0
A1: A0+(0,((linewid/10))*(4*3/2)); "\sf A1 " rjust at A1
A2: A1+(0,((linewid/10))*(4*3/2)); "\sf A2 " rjust at A2
  move to (-0.2,0)   # Lettering within the global object 

# Buffer strings
 line right 3*(linewid/10)*5/2 from A2
   B1:        [Tm: line from (((linewid/10))*(3.5),0) \
     to (0,((linewid/10))*(-4/2)) \
     then to (0,((linewid/10))*(4/2)) \
     then to (((linewid/10))*(3.5),0)
     Tc: (((linewid/10))*(3.5/2),0)
            NE: (((linewid/10))*(3.5/2),((linewid/10))*(4/4))
      SE: (((linewid/10))*(3.5/2),((linewid/10))*(-4/4))
           Out: (((linewid/10))*(3.5+(3/2)),0)
    N_Out: circle diam (3/2)*(linewid/10) \
     at (((linewid/10))*(3.5+((3/2)/2)),0)
            In1: (0,0)
      C: (((linewid/10))*(3.5/3),0)
      
  
  
  ]; line right 2*(linewid/10)*5/2
   T1: last line.c
   B2:        [Tm: line from (((linewid/10))*(3.5),0) \
     to (0,((linewid/10))*(-4/2)) \
     then to (0,((linewid/10))*(4/2)) \
     then to (((linewid/10))*(3.5),0)
     Tc: (((linewid/10))*(3.5/2),0)
           In1: (((linewid/10))*(-(3/2)),0)
    N_In1: circle diam (3/2)*(linewid/10) \
      at (((linewid/10))*(-((3/2)/2)),0)
      NE: (((linewid/10))*(3.5/2),((linewid/10))*(4/4))
      SE: (((linewid/10))*(3.5/2),((linewid/10))*(-4/4))
                Out: (((linewid/10))*(3.5),0)
        C: (((linewid/10))*(3.5/3),0)
      
  
  
  ] 
   line right 3*(linewid/10)*5/2 from A1
   B3:        [Tm: line from (((linewid/10))*(3.5),0) \
     to (0,((linewid/10))*(-4/2)) \
     then to (0,((linewid/10))*(4/2)) \
     then to (((linewid/10))*(3.5),0)
     Tc: (((linewid/10))*(3.5/2),0)
            NE: (((linewid/10))*(3.5/2),((linewid/10))*(4/4))
      SE: (((linewid/10))*(3.5/2),((linewid/10))*(-4/4))
           Out: (((linewid/10))*(3.5+(3/2)),0)
    N_Out: circle diam (3/2)*(linewid/10) \
     at (((linewid/10))*(3.5+((3/2)/2)),0)
            In1: (0,0)
      C: (((linewid/10))*(3.5/3),0)
      
  
  
  ]; line right 2*(linewid/10)*5/2
   T2: last line.c
   B4:        [Tm: line from (((linewid/10))*(3.5),0) \
     to (0,((linewid/10))*(-4/2)) \
     then to (0,((linewid/10))*(4/2)) \
     then to (((linewid/10))*(3.5),0)
     Tc: (((linewid/10))*(3.5/2),0)
           In1: (((linewid/10))*(-(3/2)),0)
    N_In1: circle diam (3/2)*(linewid/10) \
      at (((linewid/10))*(-((3/2)/2)),0)
      NE: (((linewid/10))*(3.5/2),((linewid/10))*(4/4))
      SE: (((linewid/10))*(3.5/2),((linewid/10))*(-4/4))
                Out: (((linewid/10))*(3.5),0)
        C: (((linewid/10))*(3.5/3),0)
      
  
  
  ] 
   line right 3*(linewid/10)*5/2 from A0
   B5:        [Tm: line from (((linewid/10))*(3.5),0) \
     to (0,((linewid/10))*(-4/2)) \
     then to (0,((linewid/10))*(4/2)) \
     then to (((linewid/10))*(3.5),0)
     Tc: (((linewid/10))*(3.5/2),0)
            NE: (((linewid/10))*(3.5/2),((linewid/10))*(4/4))
      SE: (((linewid/10))*(3.5/2),((linewid/10))*(-4/4))
           Out: (((linewid/10))*(3.5+(3/2)),0)
    N_Out: circle diam (3/2)*(linewid/10) \
     at (((linewid/10))*(3.5+((3/2)/2)),0)
            In1: (0,0)
      C: (((linewid/10))*(3.5/3),0)
      
  
  
  ]; line right 2*(linewid/10)*5/2
   T3: last line.c
   B6:        [Tm: line from (((linewid/10))*(3.5),0) \
     to (0,((linewid/10))*(-4/2)) \
     then to (0,((linewid/10))*(4/2)) \
     then to (((linewid/10))*(3.5),0)
     Tc: (((linewid/10))*(3.5/2),0)
           In1: (((linewid/10))*(-(3/2)),0)
    N_In1: circle diam (3/2)*(linewid/10) \
      at (((linewid/10))*(-((3/2)/2)),0)
      NE: (((linewid/10))*(3.5/2),((linewid/10))*(4/4))
      SE: (((linewid/10))*(3.5/2),((linewid/10))*(-4/4))
                Out: (((linewid/10))*(3.5),0)
        C: (((linewid/10))*(3.5/3),0)
      
  
  
  ] 
  

B7:        [Tm: line from (((linewid/10))*(3.5),0) \
     to (0,((linewid/10))*(-4/2)) \
     then to (0,((linewid/10))*(4/2)) \
     then to (((linewid/10))*(3.5),0)
     Tc: (((linewid/10))*(3.5/2),0)
            NE: (((linewid/10))*(3.5/2),((linewid/10))*(4/4))
      SE: (((linewid/10))*(3.5/2),((linewid/10))*(-4/4))
                Out: (((linewid/10))*(3.5),0)
      In1: (0,0)
      C: (((linewid/10))*(3.5/3),0)
      
  
  
  ] at (B1,C)

G1:       [           Bt: line from (((linewid/10))*(0+7/3),((linewid/10))*((2*3)/2)) \
     to (0,((linewid/10))*((2*3)/2)) chop 0 chop -(linethick *(scale/72)/2)
    ArcB: arc cw to (0,((linewid/10))*(-(2*3)/2)) \
      with .c at (((linewid/10))*(0-sqrt((7*(2*3)/((2*3)))^2-((2*3)/2)^2)),0)
    Bb: line to (((linewid/10))*(0+7/3),((linewid/10))*(-(2*3)/2)) chop -(linethick *(scale/72)/2) chop 0
         ArcN: arc  cw from (((linewid/10))*(0+7/3),((linewid/10))*((2*3)/2)) \
     to (((linewid/10))*(0+7),0) \
     with .c at (((linewid/10))*(0+7/3),((linewid/10))*(-((7*2/3)^2-((2*3)/2)^2)/((2*3))))
   ArcS: arc ccw from (((linewid/10))*(0+7/3),((linewid/10))*(-(2*3)/2)) \
     to (((linewid/10))*(0+7),0) \
     with .c at (((linewid/10))*(0+7/3),((linewid/10))*(((7*2/3)^2-((2*3)/2)^2)/((2*3))))
          NE: (((linewid/10))*(0+7/3),((linewid/10))*(-((7*2/3)^2-((2*3)/2)^2)/((2*3))))+(((linewid/10))*(((2*3)/2+((7*2/3)^2-((2*3)/2)^2)/((2*3)))*(cos((60)*dtor_))),((linewid/10))*(((2*3)/2+((7*2/3)^2-((2*3)/2)^2)/((2*3)))*(sin((60)*dtor_))))
      SE: (((linewid/10))*(0+7/3),((linewid/10))*(((7*2/3)^2-((2*3)/2)^2)/((2*3))))+(((linewid/10))*(((2*3)/2+((7*2/3)^2-((2*3)/2)^2)/((2*3)))*(cos((-60)*dtor_))),((linewid/10))*(((2*3)/2+((7*2/3)^2-((2*3)/2)^2)/((2*3)))*(sin((-60)*dtor_))))
            N_Out: circle diam (3/2)*(linewid/10) \
    at (((linewid/10))*(0+7+((3/2)/2)),0)
    Out: (((linewid/10))*(0+7+(3/2)),0)
                         In1: (((linewid/10))*(-sqrt((7*(2*3)/((2*3)))^2-((2*3)/2)^2)+sqrt((7*(2*3)/((2*3)))^2-((2*3)/2/min(2,6-1)*(2+1-2*1))^2)),((linewid/10))*((2*3)/2/min(2,6-1)*(2+1-2*1)))
            
       In2: (((linewid/10))*(-sqrt((7*(2*3)/((2*3)))^2-((2*3)/2)^2)+sqrt((7*(2*3)/((2*3)))^2-((2*3)/2/min(2,6-1)*(2+1-2*2))^2)),((linewid/10))*((2*3)/2/min(2,6-1)*(2+1-2*2)))
            
  
  
    C: (((linewid/10))*(0+7/2),0)
  ] with .Out at (B1.Out,DE)
G2:       [           Bt: line from (((linewid/10))*(0+7/3),((linewid/10))*((2*3)/2)) \
     to (0,((linewid/10))*((2*3)/2)) chop 0 chop -(linethick *(scale/72)/2)
    ArcB: arc cw to (0,((linewid/10))*(-(2*3)/2)) \
      with .c at (((linewid/10))*(0-sqrt((7*(2*3)/((2*3)))^2-((2*3)/2)^2)),0)
    Bb: line to (((linewid/10))*(0+7/3),((linewid/10))*(-(2*3)/2)) chop -(linethick *(scale/72)/2) chop 0
         ArcN: arc  cw from (((linewid/10))*(0+7/3),((linewid/10))*((2*3)/2)) \
     to (((linewid/10))*(0+7),0) \
     with .c at (((linewid/10))*(0+7/3),((linewid/10))*(-((7*2/3)^2-((2*3)/2)^2)/((2*3))))
   ArcS: arc ccw from (((linewid/10))*(0+7/3),((linewid/10))*(-(2*3)/2)) \
     to (((linewid/10))*(0+7),0) \
     with .c at (((linewid/10))*(0+7/3),((linewid/10))*(((7*2/3)^2-((2*3)/2)^2)/((2*3))))
          NE: (((linewid/10))*(0+7/3),((linewid/10))*(-((7*2/3)^2-((2*3)/2)^2)/((2*3))))+(((linewid/10))*(((2*3)/2+((7*2/3)^2-((2*3)/2)^2)/((2*3)))*(cos((60)*dtor_))),((linewid/10))*(((2*3)/2+((7*2/3)^2-((2*3)/2)^2)/((2*3)))*(sin((60)*dtor_))))
      SE: (((linewid/10))*(0+7/3),((linewid/10))*(((7*2/3)^2-((2*3)/2)^2)/((2*3))))+(((linewid/10))*(((2*3)/2+((7*2/3)^2-((2*3)/2)^2)/((2*3)))*(cos((-60)*dtor_))),((linewid/10))*(((2*3)/2+((7*2/3)^2-((2*3)/2)^2)/((2*3)))*(sin((-60)*dtor_))))
            N_Out: circle diam (3/2)*(linewid/10) \
    at (((linewid/10))*(0+7+((3/2)/2)),0)
    Out: (((linewid/10))*(0+7+(3/2)),0)
                         In1: (((linewid/10))*(-sqrt((7*(2*3)/((2*3)))^2-((2*3)/2)^2)+sqrt((7*(2*3)/((2*3)))^2-((2*3)/2/min(2,6-1)*(2+1-2*1))^2)),((linewid/10))*((2*3)/2/min(2,6-1)*(2+1-2*1)))
            
       In2: (((linewid/10))*(-sqrt((7*(2*3)/((2*3)))^2-((2*3)/2)^2)+sqrt((7*(2*3)/((2*3)))^2-((2*3)/2/min(2,6-1)*(2+1-2*2))^2)),((linewid/10))*((2*3)/2/min(2,6-1)*(2+1-2*2)))
            
  
  
    C: (((linewid/10))*(0+7/2),0)
  ] at (B2+(((linewid/10))*(((3/2)/2)),0),G1-(0,((linewid/10))*((2*3))))
G3:                  [ Bm: line from (((linewid/10))*(7-(2*3)/2),((linewid/10))*(-(2*3)/2)) \
     to (0,((linewid/10))*(-(2*3)/2)) \
     then to (0,((linewid/10))*((2*3)/2)) then \
     to (((linewid/10))*(7-(2*3)/2),((linewid/10))*((2*3)/2))
       Arc: arc cw rad (2*3)/2 \
     to Here+(0,((linewid/10))*(-(2*3))) \
     with .c at Here+(0,((linewid/10))*(-(2*3)/2))
           NE: (((linewid/10))*(7-(2*3)/2),0)+(((linewid/10))*(((2*3)/2)*(cos((45)*dtor_))),((linewid/10))*(((2*3)/2)*(sin((45)*dtor_))))
         SE: (((linewid/10))*(7-(2*3)/2),0)+(((linewid/10))*(((2*3)/2)*(cos((-45)*dtor_))),((linewid/10))*(((2*3)/2)*(sin((-45)*dtor_))))
             Out: (((linewid/10))*(7),0)
               
   In1: (0,((linewid/10))*((2*3)/min(4,6-1)*((4+1)/2-1)))     
   In2: (0,((linewid/10))*((2*3)/min(4,6-1)*((4+1)/2-2)))     
   In3: (0,((linewid/10))*((2*3)/min(4,6-1)*((4+1)/2-3)))     
   In4: (0,((linewid/10))*((2*3)/min(4,6-1)*((4+1)/2-4)))     
   
    C: (((linewid/10))*(7/2),0)
  ] with .In1 at (G2.Out+(9*(linewid/10)*5/2,0),A2)
G5:                  [ Bm: line from (((linewid/10))*(7-(2*3)/2),((linewid/10))*(-(2*3)/2)) \
     to (0,((linewid/10))*(-(2*3)/2)) \
     then to (0,((linewid/10))*((2*3)/2)) then \
     to (((linewid/10))*(7-(2*3)/2),((linewid/10))*((2*3)/2))
       Arc: arc cw rad (2*3)/2 \
     to Here+(0,((linewid/10))*(-(2*3))) \
     with .c at Here+(0,((linewid/10))*(-(2*3)/2))
           NE: (((linewid/10))*(7-(2*3)/2),0)+(((linewid/10))*(((2*3)/2)*(cos((45)*dtor_))),((linewid/10))*(((2*3)/2)*(sin((45)*dtor_))))
         SE: (((linewid/10))*(7-(2*3)/2),0)+(((linewid/10))*(((2*3)/2)*(cos((-45)*dtor_))),((linewid/10))*(((2*3)/2)*(sin((-45)*dtor_))))
             Out: (((linewid/10))*(7),0)
               
   In1: (0,((linewid/10))*((2*3)/min(4,6-1)*((4+1)/2-1)))     
   In2: (0,((linewid/10))*((2*3)/min(4,6-1)*((4+1)/2-2)))     
   In3: (0,((linewid/10))*((2*3)/min(4,6-1)*((4+1)/2-3)))     
   In4: (0,((linewid/10))*((2*3)/min(4,6-1)*((4+1)/2-4)))     
   
    C: (((linewid/10))*(7/2),0)
  ] with .In4 at (G3.In1,G2.Out)
G6:            [ Bm: line from (((linewid/10))*(7-(2*3)/2),((linewid/10))*(-(2*3)/2)) \
     to (0,((linewid/10))*(-(2*3)/2)) \
     then to (0,((linewid/10))*((2*3)/2)) then \
     to (((linewid/10))*(7-(2*3)/2),((linewid/10))*((2*3)/2))
       Arc: arc cw rad (2*3)/2 \
     to Here+(0,((linewid/10))*(-(2*3))) \
     with .c at Here+(0,((linewid/10))*(-(2*3)/2))
           NE: (((linewid/10))*(7-(2*3)/2),0)+(((linewid/10))*(((2*3)/2)*(cos((45)*dtor_))),((linewid/10))*(((2*3)/2)*(sin((45)*dtor_))))
         SE: (((linewid/10))*(7-(2*3)/2),0)+(((linewid/10))*(((2*3)/2)*(cos((-45)*dtor_))),((linewid/10))*(((2*3)/2)*(sin((-45)*dtor_))))
             Out: (((linewid/10))*(7),0)
               
   In1: (0,((linewid/10))*((2*3)/min(2,6-1)*((2+1)/2-1)))     
   In2: (0,((linewid/10))*((2*3)/min(2,6-1)*((2+1)/2-2)))     
   
    C: (((linewid/10))*(7/2),0)
  ] at G5+(((linewid/10))*(7),((linewid/10))*((2*3)*3/4))+((linewid/10)*5/2*2,0)
G4:       [           Bt: line from (((linewid/10))*(0+7/3),((linewid/10))*((2*3)/2)) \
     to (0,((linewid/10))*((2*3)/2)) chop 0 chop -(linethick *(scale/72)/2)
    ArcB: arc cw to (0,((linewid/10))*(-(2*3)/2)) \
      with .c at (((linewid/10))*(0-sqrt((7*(2*3)/((2*3)))^2-((2*3)/2)^2)),0)
    Bb: line to (((linewid/10))*(0+7/3),((linewid/10))*(-(2*3)/2)) chop -(linethick *(scale/72)/2) chop 0
         ArcN: arc  cw from (((linewid/10))*(0+7/3),((linewid/10))*((2*3)/2)) \
     to (((linewid/10))*(0+7),0) \
     with .c at (((linewid/10))*(0+7/3),((linewid/10))*(-((7*2/3)^2-((2*3)/2)^2)/((2*3))))
   ArcS: arc ccw from (((linewid/10))*(0+7/3),((linewid/10))*(-(2*3)/2)) \
     to (((linewid/10))*(0+7),0) \
     with .c at (((linewid/10))*(0+7/3),((linewid/10))*(((7*2/3)^2-((2*3)/2)^2)/((2*3))))
          NE: (((linewid/10))*(0+7/3),((linewid/10))*(-((7*2/3)^2-((2*3)/2)^2)/((2*3))))+(((linewid/10))*(((2*3)/2+((7*2/3)^2-((2*3)/2)^2)/((2*3)))*(cos((60)*dtor_))),((linewid/10))*(((2*3)/2+((7*2/3)^2-((2*3)/2)^2)/((2*3)))*(sin((60)*dtor_))))
      SE: (((linewid/10))*(0+7/3),((linewid/10))*(((7*2/3)^2-((2*3)/2)^2)/((2*3))))+(((linewid/10))*(((2*3)/2+((7*2/3)^2-((2*3)/2)^2)/((2*3)))*(cos((-60)*dtor_))),((linewid/10))*(((2*3)/2+((7*2/3)^2-((2*3)/2)^2)/((2*3)))*(sin((-60)*dtor_))))
            N_Out: circle diam (3/2)*(linewid/10) \
    at (((linewid/10))*(0+7+((3/2)/2)),0)
    Out: (((linewid/10))*(0+7+(3/2)),0)
                         In1: (((linewid/10))*(-sqrt((7*(2*3)/((2*3)))^2-((2*3)/2)^2)+sqrt((7*(2*3)/((2*3)))^2-((2*3)/2/min(2,6-1)*(2+1-2*1))^2)),((linewid/10))*((2*3)/2/min(2,6-1)*(2+1-2*1)))
            
       In2: (((linewid/10))*(-sqrt((7*(2*3)/((2*3)))^2-((2*3)/2)^2)+sqrt((7*(2*3)/((2*3)))^2-((2*3)/2/min(2,6-1)*(2+1-2*2))^2)),((linewid/10))*((2*3)/2/min(2,6-1)*(2+1-2*2)))
            
  
  
    C: (((linewid/10))*(0+7/2),0)
  ] with .In1 at (G6.Out,G3)+(2*(linewid/10)*5/2,0)
G7:       [           Bt: line from (((linewid/10))*(0+7/3),((linewid/10))*((2*3)/2)) \
     to (0,((linewid/10))*((2*3)/2)) chop 0 chop -(linethick *(scale/72)/2)
    ArcB: arc cw to (0,((linewid/10))*(-(2*3)/2)) \
      with .c at (((linewid/10))*(0-sqrt((7*(2*3)/((2*3)))^2-((2*3)/2)^2)),0)
    Bb: line to (((linewid/10))*(0+7/3),((linewid/10))*(-(2*3)/2)) chop -(linethick *(scale/72)/2) chop 0
         ArcN: arc  cw from (((linewid/10))*(0+7/3),((linewid/10))*((2*3)/2)) \
     to (((linewid/10))*(0+7),0) \
     with .c at (((linewid/10))*(0+7/3),((linewid/10))*(-((7*2/3)^2-((2*3)/2)^2)/((2*3))))
   ArcS: arc ccw from (((linewid/10))*(0+7/3),((linewid/10))*(-(2*3)/2)) \
     to (((linewid/10))*(0+7),0) \
     with .c at (((linewid/10))*(0+7/3),((linewid/10))*(((7*2/3)^2-((2*3)/2)^2)/((2*3))))
          NE: (((linewid/10))*(0+7/3),((linewid/10))*(-((7*2/3)^2-((2*3)/2)^2)/((2*3))))+(((linewid/10))*(((2*3)/2+((7*2/3)^2-((2*3)/2)^2)/((2*3)))*(cos((60)*dtor_))),((linewid/10))*(((2*3)/2+((7*2/3)^2-((2*3)/2)^2)/((2*3)))*(sin((60)*dtor_))))
      SE: (((linewid/10))*(0+7/3),((linewid/10))*(((7*2/3)^2-((2*3)/2)^2)/((2*3))))+(((linewid/10))*(((2*3)/2+((7*2/3)^2-((2*3)/2)^2)/((2*3)))*(cos((-60)*dtor_))),((linewid/10))*(((2*3)/2+((7*2/3)^2-((2*3)/2)^2)/((2*3)))*(sin((-60)*dtor_))))
            N_Out: circle diam (3/2)*(linewid/10) \
    at (((linewid/10))*(0+7+((3/2)/2)),0)
    Out: (((linewid/10))*(0+7+(3/2)),0)
                         In1: (((linewid/10))*(-sqrt((7*(2*3)/((2*3)))^2-((2*3)/2)^2)+sqrt((7*(2*3)/((2*3)))^2-((2*3)/2/min(2,6-1)*(2+1-2*1))^2)),((linewid/10))*((2*3)/2/min(2,6-1)*(2+1-2*1)))
            
       In2: (((linewid/10))*(-sqrt((7*(2*3)/((2*3)))^2-((2*3)/2)^2)+sqrt((7*(2*3)/((2*3)))^2-((2*3)/2/min(2,6-1)*(2+1-2*2))^2)),((linewid/10))*((2*3)/2/min(2,6-1)*(2+1-2*2)))
            
  
  
    C: (((linewid/10))*(0+7/2),0)
  ] with .In2 at (G4.In2,G5.Out)

# Output to other latches
TOL: (G2.Out,C)+(4*(linewid/10)*5/2,-4*(linewid/10))
  move to TOL+(3*(linewid/10)*5/2,-(linewid/10)*5/2/3) ; {move down 0.15}
  "\sf {\sl To other latches}" below

# Remaining input lines
  line from G1.In1 to (DE,G1.In1); "\sf D " rjust
  line from G1.In2 to (DE,G1.In2); "\sf E " rjust
  [  circle rad (0.04*linewid)  fill 0    ] with .c at G1.In2-((linewid/10)*5/2,0)
  move to last [].c; line to (Here,G2.In2) then to G2.In2
  line from C to B7.In1

# Connect Bi, and connect to output bus
 [  circle rad (0.04*linewid)  fill 0    ] with .c at T1.c
  move to last [].c ; line down (A2.y-A1.y)/2
  line to (TOL-(1*(linewid/10)*5/2,0),Here) ; arrow to (Here,TOL) 
   [  circle rad (0.04*linewid)  fill 0    ] with .c at T2.c
  move to last [].c ; line down (A2.y-A1.y)/2
  line to (TOL-(2*(linewid/10)*5/2,0),Here) ; arrow to (Here,TOL) 
   [  circle rad (0.04*linewid)  fill 0    ] with .c at T3.c
  move to last [].c ; line down (A2.y-A1.y)/2
  line to (TOL-(3*(linewid/10)*5/2,0),Here) ; arrow to (Here,TOL) 
  

# G1 to G2
  [  circle rad (0.04*linewid)  fill 0    ] with .c at (T1.c,G1)
  move to last [].c; line to (Here,G2.In1) then to G2.In1

# Upper And inputs to output bus
 line left 4*(linewid/10)*5/2 from G3.In1
  arrow to (Here,TOL) 
   line left 3*(linewid/10)*5/2 from G3.In2
  arrow to (Here,TOL) 
   line left 2*(linewid/10)*5/2 from G3.In3
  arrow to (Here,TOL) 
   line left 1*(linewid/10)*5/2 from G3.In4
  arrow to (Here,TOL) 
  

  line from B2.Out to (G3.In1,B2)-(4*(linewid/10)*5/2,0) ; [  circle rad (0.04*linewid)  fill 0    ] with .c at Here
  move to last [].c
  line from B4.Out to (G3.In2,B4)-(3*(linewid/10)*5/2,0) ; [  circle rad (0.04*linewid)  fill 0    ] with .c at Here
  move to last [].c
  line from B6.Out to (G3.In3,B6)-(2*(linewid/10)*5/2,0) ; [  circle rad (0.04*linewid)  fill 0    ] with .c at Here
  move to last [].c
  line from G1.Out to (G3.In4,G1)-((linewid/10)*5/2,0) ; [  circle rad (0.04*linewid)  fill 0    ] with .c at Here
  move to last [].c

# Lower And inputs
  line left 4*(linewid/10)*5/2 from G5.In1 ; [  circle rad (0.04*linewid)  fill 0    ] with .c at Here
  move to last [].c
  line left 3*(linewid/10)*5/2 from G5.In2 ; [  circle rad (0.04*linewid)  fill 0    ] with .c at Here
  move to last [].c
  line left 2*(linewid/10)*5/2 from G5.In3 ; [  circle rad (0.04*linewid)  fill 0    ] with .c at Here
  move to last [].c
  line from G2.Out to G5.In4 ; [  circle rad (0.04*linewid)  fill 0    ] with .c at (TOL,Here)
  move to last [].c ; arrow to (Here,TOL)

# Fix up G4, G6, G7
  line from G3.Out to G4.In1
  line right (linewid/10)*5/2 from G4.Out
  {[  circle rad (0.04*linewid)  fill 0    ] with .c at Here
  move to last [].c; line right (linewid/10)*5/2 ; "\sf  Q7" ljust; move right 0.2 } # letters in object
  line down 2*(linewid/10)*5/2 then to G6.In1+(-(linewid/10)*5/2,(linewid/10)*5/2)
    line to (Here,G6.In1) then to G6.In1
  line from G4.In2 to (G6.In1+(-(linewid/10)*5/2,0),G4.In2)
    line down (linewid/10)*5/2 then to G7.Out+((linewid/10)*5/2,2*(linewid/10)*5/2)
    line to (Here,G7) then to G7.Out
  line from G6.Out right (linewid/10)*5/2 ; line to (Here,G7.In1) then to G7.In1
  line from G5.Out to G7.In2
  line left (linewid/10)*5/2 from G6.In2 ; arrow to (Here,TOL)
  [  circle rad (0.04*linewid)  fill 0    ] with .c at (Here,C)
  move to last [].c ; line to B7.Out

.PE