1 / 27

CMPUT329 - Fall 2003

CMPUT329 - Fall 2003. TopicJ: Counters José Nelson Amaral. Reading Material. Section 8.4 of Wakerly. S2. S1. S3. Sm. S4. S5. General Structure. A counter is a sequential circuit whose state diagram contains a single cycle.

gus
Download Presentation

CMPUT329 - Fall 2003

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CMPUT329 - Fall 2003 TopicJ: Counters José Nelson Amaral CMPUT 329 - Computer Organization and Architecture II

  2. Reading Material Section 8.4 of Wakerly. CMPUT 329 - Computer Organization and Architecture II

  3. S2 S1 S3 Sm S4 S5 General Structure A counter is a sequential circuit whose state diagram contains a single cycle. The modulus of a counter is the number of states in the cycle. A counter with m states is called a module-m counter or a divide-by-m counter. CMPUT 329 - Computer Organization and Architecture II

  4. n-bit binary ripple counter In a ripple counter, the carry information ripples from the less significant to the more significant bits. Assume that the propagation delay from T to Q in the flip-flops on the right is 10ns. How long do we have to wait after a clock input to read the value of the counter? Is the waiting time dependent on the modulus of the counter? CMPUT 329 - Computer Organization and Architecture II

  5. Synchronous Counters In a synchronous counter, all flip-flops are connected to a common clock so that all the outputs change approximately at the same time. However this synchronous counter has a serial enable logic that limits the speed of the clock. A synchronous counter with serial enable logic is called a synchronous serial counter. CMPUT 329 - Computer Organization and Architecture II

  6. Synchronous Counters A synchronous counter with a parallel enable logic drives each EN input with a dedicated AND gate. A synchronous counter with parallel enable logic is called a synchronous parallel counter. CMPUT 329 - Computer Organization and Architecture II

  7. The 74x163 The 74x163 is a synchronous 4-bit binary counter with:  active low load input  active low clear input When the load input is active and the clear input is not active, then the value in the inputs A, B, C, and D is loaded into the counter. RCO is the Ripple Carry Output. It is 1 when all outputs QA, QB, QC, QD are 1 and the enable input ENT is asserted. CMPUT 329 - Computer Organization and Architecture II

  8. 74x163 CMPUT 329 - Computer Organization and Architecture II

  9. 74x163 CMPUT 329 - Computer Organization and Architecture II

  10. A free-running 74x163 A counter is free-running when it counts continuously independent of enable or clear inputs. The following connections convert the 74x163 into a free-running, divide-by-16 counter Quiz: How do you use the 74x163 to implement a free-running divide-by-8 counter? CMPUT 329 - Computer Organization and Architecture II

  11. Free-running divide-by-16 counter waveforms CMPUT 329 - Computer Organization and Architecture II

  12. A Counter Quiz Quiz: Use the 74x163 and any additional logic that you need to implement a free-running divide-by-8 counter. CMPUT 329 - Computer Organization and Architecture II

  13. Counter Quiz #2 Quiz: Use the 74x163 and any additional logic that you need to implement a free-running modulo-11 counter that counts the sequence 5, 6, ..., 14, 15, 5, 6, ..., 14, 15, 5, 6, .... CMPUT 329 - Computer Organization and Architecture II

  14. Counter Quiz #2 Quiz: Use the 74x163 and any additional logic that you need to implement a free-running modulo-11 counter that counts the sequence 5, 6, ..., 14, 15, 5, 6, ..., 14, 15, 5, 6, .... CMPUT 329 - Computer Organization and Architecture II

  15. Counter Quiz #3 Quiz: Use the 74x163 and any additional logic that you need to implement a free-running modulo-11 counter that counts the sequence 0, 1, ..., 9, 10, 0, 1, ..., 9, 10, 0, 1, .... CMPUT 329 - Computer Organization and Architecture II

  16. Counter Quiz #3 Quiz: Use the 74x163 and any additional logic that you need to implement a free-running modulo-11 counter that counts the sequence 0, 1, ..., 9, 10, 0, 1, ..., 9, 10, 0, 1, .... CMPUT 329 - Computer Organization and Architecture II

  17. CLOCK, RESET_L, and LOAD_L are connected in parallel. Cascading Counters CMPUT 329 - Computer Organization and Architecture II

  18. Cascading Counters A master count-enable (CNTEN) is connect to the low order 74x163. CMPUT 329 - Computer Organization and Architecture II

  19. Cascading Counters The RC04 output is asserted if and only if the low-order ‘163 is in state15 and CNTEN is asserted. Cascading counters has the same ripple effect as a serial counter. The maximum counting speed is limited by the propagation delay. CMPUT 329 - Computer Organization and Architecture II

  20. Quiz #4 Design a module-193 counter that counts from 63 to 255. This counter should start counting when a GO_L input is asserted. When the counter reaches 255, it should stop and should not re-start until GO_L is asserted again. CMPUT 329 - Computer Organization and Architecture II

  21. A module-193 Go-Counter. When MAXCNT is asserted, GO_L controls the counter CMPUT 329 - Computer Organization and Architecture II

  22. If GO_L is asserted, The counter is reloaded with 63. which de-assert MAXCNT A module-193 Go-Counter. CMPUT 329 - Computer Organization and Architecture II

  23. Counting Direction Sometimes we want to be able to select the direction of counting. Design a module-4 counter with an up/dn input that controls the direction of counting. If up/dn = 1 the counter counts up otherwise it counts down. 0 up/dn=1 up/dn=1 up/dn=0 up/dn=0 3 1 up/dn=0 up/dn=0 up/dn=1 2 up/dn=1 CMPUT 329 - Computer Organization and Architecture II

  24. Counting Direction The 74x169 is a module-16 up/down counter CMPUT 329 - Computer Organization and Architecture II

  25. Decoding Binary-Counter States By combining a binary counter with a decoder, we obtain a set of 1-out-of-m coded states. CMPUT 329 - Computer Organization and Architecture II

  26. Function HazardsDifferent delays in the 138 cause glitches in the output CMPUT 329 - Computer Organization and Architecture II

  27. Glitch-free 1-out-of-m coded signals CMPUT 329 - Computer Organization and Architecture II

More Related