CS 140L Lecture 5 Professor CK Cheng CSE Dept. UC San Diego
Counters Synchronous counters Johnson counters Odd Length counters
Synchronous Counter D Q D Q D Q CLK C(t+1) = C’(t) B(t+1) = B(t) + C(t) A(t+1) = A(t) + (B(t)C(t)) A B C A(t+1) B(t+1) C(t+1) A BC
1.There are two things to keep track of: cost vs. performance. 2.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. 3.As the length of the counter increases, the cost increases, since the number of gates increases. Synchronous vs Asynchronous Counters
Johnson Counter: A Shifter with An Inverted Feedback Loop D Q CLK CLR D Q D Q Q’ ABC Time Steps A B C 1)Given n flip-flops, we have 2n states. Much less than previous counters. But Johnson is fast! 2)Only one output changes (low power). 3)Each output has n clock width (symmetrical). 4)Reset is needed. (ie, starts with 010, the counter ends up as 010->101->010->101)
Odd Length Walking – Ring Counter A Shifter with Twisted Feedback Loops J K CLR Q Q’ J K Q J K Q ABC Time Steps A B C J A K A A (t+1) 0 0 A(t) A’(t) n JK F-Fs => 2n-1 states The counter works itself back to the proper sequence.
Pseudo Random Sequencer n = 4, length = 15 D Q CLK D Q D Q D Q