70 likes | 82 Views
Learn about the differences between synchronous and asynchronous counters, their performance, cost factors, and implementation. Explore examples like Johnson Counters and Odd-Length Walking Ring Counters to understand design considerations and sequence generation in circuits. Effectively manage cost and performance trade-offs in counter design for optimal results.
E N D
CS 140L Lecture 5: Counters Professor CK Cheng CSE Dept. UC San Diego
Counters Synchronous counters Johnson counters Odd Length counters
Synchronous Counter Q Q Q A B C D D D DC DA DB State Table CLK A B C A(t+1) B(t+1) C(t+1) 0 0 0 0 0 0 1 1 0 0 1 0 1 0 2 0 1 0 0 1 1 3 0 1 1 1 0 0 4 1 0 0 1 0 1 5 1 0 1 1 1 0 6 1 1 0 1 1 1 7 1 1 1 0 0 0 Combinational Logic C(t+1) = DC(t) = C’(t) B(t+1) = DB(t)= B(t) + C(t) A(t+1) = DA(t)= A(t) + (B(t)C(t))
Synchronous vs Asynchronous Counters • There are two things to keep track of: cost vs. performance. • For example, the synchronous counter has better performance but higher costs due to the added gates. On the other hand, the asynchronous counter is easier to implement. • As the length of the counter increases, the cost increases, since the number of gates increases. Exercise: What factors limit of the length of the counter?
Johnson Counter: A Shifter with An Inverted Feedback Loop A B C Q Q Q D D D Q’ CLR CLK • Given n flip-flops, we have 2n states. Much less than previous counters. But Johnson is fast! • Only one output changes (low power). • Each output has n clock width (symmetrical). • Reset is needed. (ie, starts with 010, the counter ends up as 010->101->010->101) Time Steps A B C • 0 0 0 • 2 1 0 0 • 1 1 0 • 1 1 1 • 0 1 1 • 0 0 1 • 0 0 0
Odd Length Walking – Ring CounterA Shifter with Twisted Feedback Loops A B C Q Q J J Q J CLR K Q’ K Q’ K Q’ Time Steps A B C • 0 0 0 0 • 1 1 0 0 • 2 1 1 0 • 0 1 1 • 0 0 1 • 0 0 0 • 1 0 0 • 1 1 0 JA KA A(t+1) 0 0 A(t) 0 1 0 1 0 1 1 1 A’(t) n JK F-Fs => 2n-1 states The counter works itself back to the proper sequence.
Pseudo Random Sequencer D0= Q3 XNOR Q2 Q0 Q1 Q2 Q3 Q Q Q Q D D D D CLK n = 4, length = 15