home *** CD-ROM | disk | FTP | other *** search
- SKIP COUNTER
-
- Here is a counter which might be called an elevator counter. It counts up
- and down taking care never to visit the number 13. This specialized
- counter is defined as a numerical map, allowing the detailed Boolean logic
- to be synthesized automatically by the PLD compiler. See Chapter 5 of the
- reference guide for a discussion of numerical maps.
-
- |PAL16V8 in:(RESET, UP), io:Q[3..0], clock:CLK
- |
- | Map: Q[3..0] -> Q[3..0]
- | { n -> n+1, RESET' & UP & n/=12
- | n -> n+2, RESET' & UP & n==12
- | n -> n-1, RESET' & UP' & n/=14
- | n -> n-2, RESET' & UP' & n==14
- | n -> 1, RESET }
- |
- | Registers: CLK // Q[3..0]
-
- | Vectors:
- | { Display (CLK)c, " Direction ", UP, " Floor ", (Q[3..0])d
- |
- | Test RESET=1; CLK
- | Clear RESET
- | Test UP=1; CLK=13(0,1)
- | Test UP=0; CLK=14(0,1)
- | End }
-
-