Rev | Line | |
---|
[11] | 1 | # vl2mv counter.v |
---|
| 2 | # version: 0.2 |
---|
| 3 | # date: 11:12:24 12/11/95 (PST) |
---|
| 4 | .model counter |
---|
| 5 | # I/O ports |
---|
| 6 | |
---|
| 7 | .names _n0 |
---|
| 8 | 1 |
---|
| 9 | .subckt counter_cell bit0 carry_in=_n0 carry_out=out0 |
---|
| 10 | .subckt counter_cell bit1 carry_in=out0 carry_out=out1 |
---|
| 11 | .subckt counter_cell bit2 carry_in=out1 carry_out=out2 |
---|
| 12 | # conflict arbitrators |
---|
| 13 | # non-blocking assignments |
---|
| 14 | # latches |
---|
| 15 | # quasi-continuous assignment |
---|
| 16 | .end |
---|
| 17 | |
---|
| 18 | |
---|
| 19 | .model counter_cell |
---|
| 20 | # I/O ports |
---|
| 21 | .inputs carry_in |
---|
| 22 | .outputs carry_out |
---|
| 23 | |
---|
| 24 | # assign carry_out = value & carry_in |
---|
| 25 | # value & carry_in |
---|
| 26 | .names value carry_in _n2 |
---|
| 27 | .def 0 |
---|
| 28 | 1 1 1 |
---|
| 29 | .names _n2 carry_out$raw_n1 |
---|
| 30 | - =_n2 |
---|
| 31 | # value = 0 |
---|
| 32 | .names value$raw_n3 |
---|
| 33 | 0 |
---|
| 34 | # non-blocking assignments for initial |
---|
| 35 | .names _n6 |
---|
| 36 | 0 |
---|
| 37 | .names value _n6 _n7 |
---|
| 38 | .def 0 |
---|
| 39 | 0 1 1 |
---|
| 40 | 1 0 1 |
---|
| 41 | .names _n7 _n5 |
---|
| 42 | 0 1 |
---|
| 43 | 1 0 |
---|
| 44 | .names _n5 _n4 |
---|
| 45 | 1 1 |
---|
| 46 | 0 0 |
---|
| 47 | # value = carry_in |
---|
| 48 | .names carry_in value$_n4_n9$true |
---|
| 49 | - =carry_in |
---|
| 50 | .names _nc |
---|
| 51 | 1 |
---|
| 52 | .names value _nc _nd |
---|
| 53 | .def 0 |
---|
| 54 | 0 1 1 |
---|
| 55 | 1 0 1 |
---|
| 56 | .names _nd _nb |
---|
| 57 | 0 1 |
---|
| 58 | 1 0 |
---|
| 59 | .names _nb _na |
---|
| 60 | 1 1 |
---|
| 61 | 0 0 |
---|
| 62 | .names _n10 |
---|
| 63 | 0 |
---|
| 64 | # carry_in == 0 |
---|
| 65 | .names carry_in _n10 _n11 |
---|
| 66 | .def 0 |
---|
| 67 | 0 1 1 |
---|
| 68 | 1 0 1 |
---|
| 69 | .names _n11 _nf |
---|
| 70 | 0 1 |
---|
| 71 | 1 0 |
---|
| 72 | .names _nf _n13 |
---|
| 73 | - =_nf |
---|
| 74 | # value = 1 |
---|
| 75 | .names value$_nf_n14$true |
---|
| 76 | 1 |
---|
| 77 | # value = 0 |
---|
| 78 | .names value$_nf_n15$false |
---|
| 79 | 0 |
---|
| 80 | # if/else (carry_in == 0) |
---|
| 81 | .names value$_nf_n14$true value$_nf_n15$false _nf value$_nf$raw_n17 |
---|
| 82 | 0 - 1 0 |
---|
| 83 | 1 - 1 1 |
---|
| 84 | - 0 0 0 |
---|
| 85 | - 1 0 1 |
---|
| 86 | # case (value ) |
---|
| 87 | .names value$_nf$raw_n17 value _na value$_na$raw_n1d |
---|
| 88 | 0 - 1 0 |
---|
| 89 | 1 - 1 1 |
---|
| 90 | - 0 0 0 |
---|
| 91 | - 1 0 1 |
---|
| 92 | .names value$_n4_n9$true value$_na$raw_n1d _n4 value$_n4$raw_n1f |
---|
| 93 | 0 - 1 0 |
---|
| 94 | 1 - 1 1 |
---|
| 95 | - 0 0 0 |
---|
| 96 | - 1 0 1 |
---|
| 97 | # conflict arbitrators |
---|
| 98 | .names _n4 _na _n13 _n24 |
---|
| 99 | .def 0 |
---|
| 100 | 1 - - 1 |
---|
| 101 | 0 1 1 1 |
---|
| 102 | 0 1 0 1 |
---|
| 103 | .names _n24 value$_n4$raw_n1f value _n25 |
---|
| 104 | 1 0 - 0 |
---|
| 105 | 1 1 - 1 |
---|
| 106 | 0 - 0 0 |
---|
| 107 | 0 - 1 1 |
---|
| 108 | .names carry_out$raw_n1 carry_out |
---|
| 109 | 0 0 |
---|
| 110 | 1 1 |
---|
| 111 | # non-blocking assignments |
---|
| 112 | # latches |
---|
| 113 | .r value$raw_n3 value |
---|
| 114 | 0 0 |
---|
| 115 | 1 1 |
---|
| 116 | .latch _n25 value |
---|
| 117 | # quasi-continuous assignment |
---|
| 118 | .end |
---|
| 119 | |
---|
| 120 | |
---|
Note: See
TracBrowser
for help on using the repository browser.