home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 13 / 13.iso / p / p078 / 7.img / TUTOR.PLB / MOD60.PLD < prev    next >
Encoding:
Text File  |  1990-12-11  |  1.3 KB  |  41 lines

  1.                             MODULO-60 C0UNTER
  2.  
  3. This counter steps through the sequence 0, 1, 2, ..., 57, 58, 59, 0.
  4. Modulo counters can be defined in several ways.  This way uses a
  5. reasonable small number of product terms; the counter is allowed to count
  6. forward if it ever gets into states 60, 61, 62, or 63, which does not
  7. happen in practice.
  8.  
  9. Q[5..0] is the six-bit counter value.
  10.  
  11. HOLD is an input signal which prevents the counter from advancing.
  12.  
  13. RESET is an input signal which clears the counter to zero on the next
  14. clock edge.
  15.  
  16. HOLDO is an output signal which prevents any higher-order counters in a
  17. cascade from advancing until the lower-level counters overflow.
  18.  
  19. CLK is the clock signal.
  20.  
  21.  
  22. |PAL16R6 in:(HOLD, RESET), out:Q[5..0], io:HOLDO, clock:CLK
  23. |
  24. | Active-Low:    "All"
  25. | Conditioning:   CLK // Q[5..0]
  26. |
  27. | Map:  Q[5..0] -> Q[5..0]
  28. | { n -> n+1, n/=59 & RESET' & HOLD'
  29. |   n -> 0,   n==59 # RESET
  30. |   n -> n,           RESET' & HOLD }
  31. |
  32. | HOLDO = Q[5..0]/=59
  33.  
  34.  
  35. |Vectors:
  36. |{ Display CLK, (Q[5..0])d, HOLDO
  37. |  Test RESET=1; CLK
  38. |  Test RESET=0; CLK=65(0,1)
  39. |  End }
  40.  
  41.