Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS1104 – Computer Organization Aaron Tan Tuck Choy School of Computing National University.

Similar presentations


Presentation on theme: "CS1104 – Computer Organization Aaron Tan Tuck Choy School of Computing National University."— Presentation transcript:

1 CS1104 – Computer Organization http://www.comp.nus.edu.sg/~cs1104 http://www.comp.nus.edu.sg/~cs1104 Aaron Tan Tuck Choy School of Computing National University of Singapore

2 CS1104-13 Introduction: Counters2  Counters are circuits that cycle through a specified number of states.  Two types of counters:  synchronous (parallel) counters  asynchronous (ripple) counters  Ripple counters allow some flip-flop outputs to be used as a source of clock for other flip-flops.  Synchronous counters apply the same clock to all flip-flops.

3 CS1104-13 Asynchronous (Ripple) Counters3  Asynchronous counters: the flip-flops do not change states at exactly the same time as they do not have a common clock pulse.  Also known as ripple counters, as the input clock pulse “ripples” through the counter – cumulative delay is a drawback.  n flip-flops  a MOD (modulus) 2 n counter. (Note: A MOD-x counter cycles through x states.)  Output of the last flip-flop (MSB) divides the input clock frequency by the MOD number of the counter, hence a counter is also a frequency divider.

4 CS1104-13 Asynchronous (Ripple) Counters4  Example: 2-bit ripple binary counter.  Output of one flip-flop is connected to the clock input of the next more-significant flip-flop. K J K J HIGH Q0Q0 Q1Q1 Q0Q0 FF1 FF0 CLK CC Timing diagram 00  01  10  11  00... 4321CLK Q0Q0 Q0Q0 Q1Q1 11 11 0 00 00 0

5 CS1104-13 Asynchronous (Ripple) Counters5  Example: 3-bit ripple binary counter. K J K J Q0Q0 Q1Q1 Q0Q0 FF1 FF0 CC K J Q1Q1 C FF2 Q2Q2 CLK HIGH

6 CS1104-13 Asynchronous (Ripple) Counters6  Propagation delays in an asynchronous (ripple- clocked) binary counter.  If the accumulated delay is greater than the clock pulse, some counter states may be misrepresented! 4321CLK Q0Q0 Q1Q1 Q2Q2 t PLH (CLK to Q 0 ) t PHL (CLK to Q 0 ) t PLH (Q 0 to Q 1 ) t PHL (CLK to Q 0 ) t PHL (Q 0 to Q 1 ) t PLH (Q 1 to Q 2 )

7 CS1104-13 Asynchronous (Ripple) Counters7  Example: 4-bit ripple binary counter (negative-edge triggered). K J K J Q1Q1 Q0Q0 FF1FF0 CC K J C FF2 Q2Q2 CLK HIGH K J C FF3 Q3Q3

8 CS1104-13 Asynchronous Counters with MOD number < 2^n 8 Asyn. Counters with MOD no. < 2 n  States may be skipped resulting in a truncated sequence.  Technique: force counter to recycle before going through all of the states in the binary sequence.  Example: Given the following circuit, determine the counting sequence (and hence the modulus no.) K JQ Q CLK CLR K JQ Q CLK CLR K JQ Q CLK CLR CBA BCBC All J, K inputs are 1 (HIGH).

9 CS1104-13 Asynchronous Counters with MOD number < 2^n 9 Asyn. Counters with MOD no. < 2 n  Example (cont’d): K JQ Q CLK CLR K JQ Q CLK CLR K JQ Q CLK CLR CBA BCBC All J, K inputs are 1 (HIGH). MOD-6 counter produced by clearing (a MOD-8 binary counter) when count of six (110) occurs.

10 CS1104-13 Asynchronous Counters with MOD number < 2^n 10 Asyn. Counters with MOD no. < 2 n  Example (cont’d): Counting sequence of circuit (in CBA order). 111 000 001 110 101 100 010 011 Temporary state Counter is a MOD-6 counter. 000000 100100 010010 110110 001001 101101 000000 100100

11 CS1104-13 Asynchronous Counters with MOD number < 2^n 11 Asyn. Counters with MOD no. < 2 n  Asynchronous decade/BCD counter (cont’d). D CLK HIGH K J C CLR Q K J C Q C K J C Q B K J C Q A (A.C)' 00000000 10001000 01000100 11001100 00100010 10101010 01100110 11101110 00010001 10011001 00000000


Download ppt "CS1104 – Computer Organization Aaron Tan Tuck Choy School of Computing National University."

Similar presentations


Ads by Google