home *** CD-ROM | disk | FTP | other *** search
- ;*-- beginning of the incrementer module -----------------
- ; This is a module which increments its 3-bit input.
- ; It also has a reset input which forces all its outputs
- ; to zero.
- ;---------------------------------------------------------
- DEFMOD incrmntr( rst, cur[0:2], nxt[0:2] )
- CHIP incrmntr Intel_arch
- PIN rst ;* reset counter to 0 (input)
- PIN cur[0:2] ;* current counter value (input)
- PIN nxt[0:2] ;* next counter value (output)
-
- ; the 3-bit incrementer is specified using the following
- ; truth table. note the first entry which says that the
- ; output will be all zeroes if the rst input is high
- ; regardless of what values the other inputs have (don't
- ; cares are signified by an "x").
- T_TAB( rst cur2 cur1 cur0 >> nxt2 nxt1 nxt0 )
- 1 x x x : 0 0 0 ;* reset to 0
- 0 0 0 0 : 0 0 1 ;* 0 -> 1
- 0 0 0 1 : 0 1 0 ;* 1 -> 2
- 0 0 1 0 : 0 1 1 ;* 2 -> 3
- 0 0 1 1 : 1 0 0 ;* 3 -> 4
- 0 1 0 0 : 1 0 1 ;* 4 -> 5
- 0 1 0 1 : 1 1 0 ;* 5 -> 6
- 0 1 1 0 : 1 1 1 ;* 6 -> 7
- 0 1 1 1 : 0 0 0 ;* 7 -> 0
- ENDMOD
- ;*-- end of the incrementer module ----------------------
-