home *** CD-ROM | disk | FTP | other *** search
- GRAY CODE COUNTER
-
- Here is a Gray code counter tested with the aid of an UNTIL clause. An
- explanation of the UNTIL clause appears in Chapter 11 of the reference
- guide.
-
- |PAL16R8 in:RESET, out:Q[3..0], clock:CLOCK
- |
- | Map: Q[3..0] -> Q[3..0]
- | { Gray(n) -> Gray((n+1)\16), RESET'
- | Gray(n) -> 0, RESET
- | }
- |
- | Registers: CLOCK // Q[3..0]
-
- |Vectors:
- |{ Display RESET, CLOCK, Q[3..0], (Q[3..0])s
- |
- | Test RESET = 1; CLOCK = 0,1 |Clear the counter
- | Test RESET = 0; CLOCK = 16(0,1) |Test the full Gray sequence
- |
- | Test CLOCK = 16(0,1) UNTIL Q[3..0]==15 |Advance until all bits are set
- | Test RESET = 1; CLOCK = 0,1 |Make sure all bits reset
- | End
- | }
-
-