| 1 |
.PS |
| 2 |
# ex21DPV.m4 |
| 3 |
log_init(svg_font(sans-serif,11bp__)) |
| 4 |
|
| 5 |
dy = 0.2 |
| 6 |
ddy = 1.8*dy |
| 7 |
textht = textht*0.9 |
| 8 |
|
| 9 |
D: FlipFlop(D) |
| 10 |
T: FlipFlop(T) with .Chip.sw at last [].se + (0.4,0) |
| 11 |
RS: FlipFlop(RS) with .Chip.sw at last [].se + (0.4,0) |
| 12 |
JK: FlipFlop(JK) with .Chip.sw at last [].se + (0.4,0) |
| 13 |
`"FlipFlop(JK)"' at JK.s below |
| 14 |
`"FlipFlop(RS)"' at (RS.s,JK.s) below |
| 15 |
`"FlipFlop(T)"' at (T.s,JK.s) below |
| 16 |
`"FlipFlop(D)"' at (D.s,JK.s) below |
| 17 |
|
| 18 |
# Test 3: synchronous 3-bit counter |
| 19 |
define(`counterFF',``$1':FlipFlop(JK) `$2' |
| 20 |
"`$1'" at `$1'.Chip.sw-(3bp__,0) below ljust |
| 21 |
"1" at `$1'.PinCLR.end above |
| 22 |
"1" at `$1'.PinPR.end below') |
| 23 |
|
| 24 |
[ |
| 25 |
right_ |
| 26 |
counterFF(FF0) |
| 27 |
counterFF(FF1,with .Chip at FF0.Chip+(-28*L_unit,0)) |
| 28 |
counterFF(FF2,with .Chip at FF1.Chip+(-28*L_unit,0)) |
| 29 |
"1" at FF0.PinJ.end rjust |
| 30 |
"1" at FF0.PinK.end rjust |
| 31 |
Dc: FF2.Chip.sw+(-9*L_unit,-7.5*L_unit) |
| 32 |
Bot: Dc+(0,-3*L_unit) |
| 33 |
|
| 34 |
left_ |
| 35 |
GAnd: AND_gate at FF1.Chip.nw+(4*L_unit,12*L_unit) |
| 36 |
right_ |
| 37 |
|
| 38 |
line from FF2.PinCK.end left 3*L_unit |
| 39 |
line to (Here,Dc); dot |
| 40 |
line from FF1.PinCK.end left 3*L_unit |
| 41 |
line to (Here,Dc); dot |
| 42 |
line from FF0.PinCK.end left 3*L_unit |
| 43 |
line to (Here,Dc) then to Dc |
| 44 |
"svg_it(D`'svg_sub(C))" rjust |
| 45 |
|
| 46 |
line from FF2.PinK.end to FF2.PinJ.end; dot |
| 47 |
line to (Here,GAnd.Out) then to GAnd.Out |
| 48 |
|
| 49 |
line from FF1.PinK.end to FF1.PinJ.end; dot |
| 50 |
line to (Here,FF1.PinCLR.end+(0,3*L_unit)) |
| 51 |
line to (GAnd.In2+(6*L_unit,0),Here) then to GAnd.In2+(6*L_unit,0); dot |
| 52 |
|
| 53 |
line from FF0.PinQ.end right 0.1; dot |
| 54 |
line from GAnd.In2 to (Here,GAnd.In2) then to (Here,Bot) |
| 55 |
"svg_it(D`'svg_sub(00))" below |
| 56 |
|
| 57 |
line right 0.1 from FF1.PinQ.end; dot |
| 58 |
line from GAnd.In1 to (Here,GAnd.In1) then to (Here,Bot) |
| 59 |
"svg_it(D`'svg_sub(01))" below |
| 60 |
|
| 61 |
line right 0.1 from FF2.PinQ.end |
| 62 |
line to (Here,Bot); "svg_it(D`'svg_sub(02))" below |
| 63 |
] with .n at 0.5<2nd[].s,3rd[].s> - (0,0.4) |
| 64 |
|
| 65 |
command "</g>" # end font |
| 66 |
.PE |