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

  1.                          COUNTER WITH BURIED REGISTERS
  2.  
  3. The global macrocells of the EP1800 have the ability to feedback two
  4. different signals.  One signal can come from the pin (as an input), the
  5. other can come from the register (as a buried register).
  6.  
  7. This example uses these special capabilities of the 1800's global
  8. macrocells to bury a counter (with a reset and load) and also to input a
  9. load value.  Each global macro cell will hold a counter bit and also feed
  10. back a load bit.  When the count value is 16, the RCO output will become
  11. active.
  12.  
  13. Another feature used is the REDUCTION keyword.  Since the reduced
  14. equations for the counter may overflow the number of product terms
  15. available when algebraic or duplicate removal is used, we need another
  16. reduction method.  The REDUCTION keyword allows us to reduce different
  17. signals with different reduction methods.  In this design Q[3..0] is
  18. reduced with the McBoole exact minimization method while RCO merely uses
  19. duplicate removal.
  20.  
  21. The miser bits are set using the configuration statement.  If the miser
  22. bits are left unprogrammed on this device, unpredictable results may
  23. occur.
  24.  
  25. Continuation markers (\) are used on the display command, for it is too
  26. long to fit on a single line.
  27.  
  28. |EP1800c in:(RESET,LOAD,ENA),
  29. |        io:D[3..0],
  30. |        ioa:RCO,
  31. |        internal:Q[3..0],
  32. |        clock:CLK
  33. |
  34. |
  35. | Conditioning: ENA ?? dff(Q[3..0], CLK, RESET)
  36. |
  37. | Configuration: "Miser:1"
  38. |
  39. | Reduction 2: Q[3..0]
  40. | Reduction 0: RCO
  41. |
  42. |
  43. | Map: Q[3..0] -> Q[3..0]
  44. | { n -> n+1,       LOAD'
  45. |   n -> D[3..0],   LOAD }
  46. |
  47. | RCO = Q[3..0]==0Fh
  48.  
  49. | Vectors:
  50. | { Display (CLK)c, " LOAD ENABLE:",LOAD,    \
  51. |                 ",  RESET:",RESET,         \
  52. |                 ",  LOAD VALUE:",D[3..0],  \
  53. |                 ",  RIPPLE CARRY OUT:",RCO
  54. |
  55. |   Test RESET=1,0             |Reset the counter.
  56. |   Test CLK=17(0,1)           |Count 17 counts, on 16 RCO will go active.
  57. |   Test D[3..0]=12;LOAD=1;CLK |Load the counter with 12.
  58. |   Test LOAD=0;CLK=5(0,1)     |Count up (at 16 RCO will go active again).
  59. |   End }
  60.  
  61.