home *** CD-ROM | disk | FTP | other *** search
- COUNTER WITH BURIED REGISTERS
-
- The global macrocells of the EP1800 have the ability to feedback two
- different signals. One signal can come from the pin (as an input), the
- other can come from the register (as a buried register).
-
- This example uses these special capabilities of the 1800's global
- macrocells to bury a counter (with a reset and load) and also to input a
- load value. Each global macro cell will hold a counter bit and also feed
- back a load bit. When the count value is 16, the RCO output will become
- active.
-
- Another feature used is the REDUCTION keyword. Since the reduced
- equations for the counter may overflow the number of product terms
- available when algebraic or duplicate removal is used, we need another
- reduction method. The REDUCTION keyword allows us to reduce different
- signals with different reduction methods. In this design Q[3..0] is
- reduced with the McBoole exact minimization method while RCO merely uses
- duplicate removal.
-
- The miser bits are set using the configuration statement. If the miser
- bits are left unprogrammed on this device, unpredictable results may
- occur.
-
- Continuation markers (\) are used on the display command, for it is too
- long to fit on a single line.
-
- |EP1800c in:(RESET,LOAD,ENA),
- | io:D[3..0],
- | ioa:RCO,
- | internal:Q[3..0],
- | clock:CLK
- |
- |
- | Conditioning: ENA ?? dff(Q[3..0], CLK, RESET)
- |
- | Configuration: "Miser:1"
- |
- | Reduction 2: Q[3..0]
- | Reduction 0: RCO
- |
- |
- | Map: Q[3..0] -> Q[3..0]
- | { n -> n+1, LOAD'
- | n -> D[3..0], LOAD }
- |
- | RCO = Q[3..0]==0Fh
-
- | Vectors:
- | { Display (CLK)c, " LOAD ENABLE:",LOAD, \
- | ", RESET:",RESET, \
- | ", LOAD VALUE:",D[3..0], \
- | ", RIPPLE CARRY OUT:",RCO
- |
- | Test RESET=1,0 |Reset the counter.
- | Test CLK=17(0,1) |Count 17 counts, on 16 RCO will go active.
- | Test D[3..0]=12;LOAD=1;CLK |Load the counter with 12.
- | Test LOAD=0;CLK=5(0,1) |Count up (at 16 RCO will go active again).
- | End }
-
-