home *** CD-ROM | disk | FTP | other *** search
- 12 BIT COUNTER USING T FLIP FLOPS
-
- This is a 12-bit binary counter implemented using the T flip-flop
- capabilities of the EP900. This design demonstrates the use of the tff
- functional form.
-
- The first parameter of the tff function is the indexed equation to
- define the logic for the counter. The second parameter is the signal that
- will clock the T flip-flop. The third parameter is the asynchronous reset
- for the flip-flop.
-
- |EP900 in:(ACLK, LOAD, RESET, CIN, I12), io:(I[11..1], Q[12..1], RCO)
- |
- | Active-High: I[12..1], Q[12..1], ACLK, LOAD, RESET
- | Active-Low: RCO, CIN
- |
- | i=12..2: Q[i] = tff((((Q[i-1..1]==0FFFh) & CIN & LOAD')
- | # ((I[i] ## Q[i]) & LOAD)), ACLK, RESET)
- |
- | i=1: Q[i] = tff(((CIN & LOAD')
- | # ((I[i] ## Q[i]) & LOAD)), ACLK, RESET)
- |
- | RCO = Q[12..1] == 0FFFh
- |
- |Vectors:
- |{ Display (ACLK)c, "IN=",(I[12..1])d, \
- | " COUNT=",(Q[12..1])d, \
- | " LOAD:",LOAD, \
- | " RESET:",RESET, \
- | " CIN:",CIN, \
- | " RCO:",RCO
- | Clear CIN, LOAD
- | Test I[12..1]=0FF0h; RESET=1; ACLK | Reset the counter
- | Test RESET=0; ACLK |Counter should not count with CIN inactive
- | Test CIN=1; ACLK=10(0,1) |Count to 10
- | Test LOAD=1; ACLK |Load a value into the counter
- | Test LOAD=0; ACLK=20(0,1) |Count and roll over (RCO should go active)
- | Test CIN=0; ACLK=2(0,1) |Hold the count
- | Test RESET=1; ACLK |Reset the counter again
- | End
- |}
-
-