Sync Counter
Sync Counter
Chapter 1 : WEEK 3
Asynchronous counter
❑ Up-counter
❑ MOD counter
❑ Decade counter
Synchronous counter
❑ Up-counter
❑ Irregular binary counter
❑ Synchronous mod counter
❑ Up/down (bidirectional) synchronous counter
❑ Cascaded counter
❑ Decade counter & BCD counter
❑ Counter decoding
2
Previous class: Asynchronous counter
Simple design
1
Q0 Q1 Q2
J Q J Q J Q
CLK
Q0 Q1 Q2
J Q J Q J Q
CLK
3
Synchronous counter
❑ Synchronous
◼ All flip-flops are simultaneously driven by common clock
2n = no. of states
n = no. of bits
4
Synchronous counter (cont.)
◼ Also known as parallel counter.
◼ Synchronous counters eliminate the propagation delay problem
because all the clock inputs (cp) are tied to a common clock.
◼ Can operate at higher clock frequencies. Asynchronous counters
are not useful at very high frequencies, especially for large
number of bits.
◼ Requires more circuitry than the asynchronous counterpart.
◼ The design starts with
❑ State diagram
❑ Truth table
❑ K-map & equation
❑ circuit
5
Excitation table
Qt Qt+1 S R J K D T
0 0 0 X 0 X 0 0
0 1 1 0 1 X 1 1
1 0 0 1 X 1 0 1
1 1 X 0 X 0 1 0
6
Types of synchronous counter
7
Design step for synchronous up counter
11 3 1 01
10
8
Design step for synchronous up counter
(continue)
Step 2: Fill in the truth table PS
Q1 Q0
0 0
Present state Next state Flip-flop inputs
0
Q1 Q0 Q1 Q0 D1 D0 NS
0 0 0 1 0 1 3 1
Q1 Q0
0 1 1 0 1 0 Q1 Q0
0 1
1 0 1 1 1 1 1 1
2
1 1 0 0 0 0
Q1 Q0
1 0
# The flip-flop inputs are based on the excitation table
PS NS
- Ignore SR
Qt Qt+1 S R J K D T - D FF follows NS
0 0 0 X 0 X 0 0 - T FF toggles according to
0 1 1 0 1 X 1 1 bit change
1 0 0 1 X 1 0 1 - For JK FF, you need to
1 1 X 0 X 0 1 0 memorize the table
9
Design step for synchronous up counter
(continue)
Step 3: Generate k-map
D1 = Q1.Q0'+Q1'.Q0 D0 = Q0'
10
Up counter using T flip-flop
◼ Using T flip-flop
0
3 1
T1 = Q0 T0 = 1
Present state Next state Flip-flop inputs
Q1 Q0 Q1 Q0 T1 T0
0 0 0 1 0 1
0 1 1 0 1 1
1 0 1 1 0 1 VCC
1 1 0 0 1 1
T0 Q0 T1 Q1
Qt Qt+1 S R J K D T
0 0 0 X 0 X 0 0 Q0' Q1'
0 1 1 0 1 X 1 1
1 0 0 1 X 1 0 1 CLK
1 1 X 0 X 0 1 0
11
Up counter using JK flip-flop
◼ Using JK flip-flop
0
3 1
J1 = Q0 K1 = Q0
Qt Qt+1 S R J K D T J0 Q0 J1 Q1
0 0 0 X 0 X 0 0
0 1 1 0 1 X 1 1
1 0 0 1 X 1 0 1 K0 Q0' K1 Q1'
1 1 X 0 X 0 1 0
CLK
12
Design of Synchronous Counter Example 1
13
Design of Synchronous Counter Example 1 (continue..)
J 0 = 1, K 0 = 1
J1 = Q0 , K1 = Q0
J 2 = Q1Q0 , K 2 = Q1Q0
Counter implementation
14
Design of Synchronous Counter Example 2
D input follows NS
15
Design of Synchronous Counter Example 2 (continue..)
01 0 1 01 1 0 01 1 0
11 1 0 11 1 0 11 1 0
10 1 1 10 0 1 10 1 0
D2 = Q2Q1Q0 + Q2 Q0 + Q2 Q1
D1 = Q1 Q0 + Q1Q0 = Q1 Q0
D0 = Q0
16
Design of Synchronous Counter Example 2 (continue..)
Q Q Q
CLR CLR CLR
FF0
FF1 FF2
CLK
Q0 Q1 Q2
17
Irregular Binary Counter
◼ Counting without according to regular sequence.
Eg: Design a counter with the irregular binary count
sequence 0→3→4→7 using D flip-flop.
◼ Answer:
D2 = Q2.Q0’+Q2’Q0
0
D1 = Q0’
7 3
D0 = Q1’
18
Synchronous mod-counter
19
Synchronous mod-counter (continue)
Present state Next state Flip-flop inputs
0 Q2 Q1 Q0 Q2 Q1 Q0 D2 D1 D0
0 0 0 0 0 1 0 0 1
0 0 1 0 1 0 0 1 0
4 1 0 1 0 0 1 1 0 1 1
0 1 1 1 0 0 1 0 0
1 0 0 0 0 0 0 0 0
1 0 1 X X X X X X
3 2 1 1 0 X X X X X X
1 1 1 X X X X X X
D2 = Q1.Q0
D1 = Q1.Q0’+Q1’.Q0
D0 = Q2’.Q0’
20
Design of Synchronous Counter Example 3
21
Design of Synchronous Counter Example 3 (continue..)
01 0 1 01 1 0 01 1 0
11 0 0 11 0 0 11 0 0
10 0 0 10 0 0 10 0 0
D2 = Q2Q1Q0
D1 = Q2 Q1Q0 + Q2Q1 Q0
D0 = Q2 Q0
22
Design of Synchronous Counter Example 3 (continue..)
CLR
Q Q CLR
Q
CLR
FF0
FF1 FF2
CLK
Q0 Q1 Q2
23
Design of Synchronous Counter Example 4
24
Design of Synchronous Counter Example 4 (continue..)
01 0 1 01 0 1 01 1 1
11 1 1 11 1 1 11 0 1
10 1 1 10 0 0 10 0 1
T2 = Q2 + Q1Q0
T1 = Q2Q0 + Q2Q1 + Q1Q0
T0 = Q2 + Q0
25
Design of Synchronous Counter Example 4 (continue..)
26
Up/Down Synchronous Counter (bidirectional counter)
27
Up/Down Synchronous Counter design procedure
0 0
3 1
0 0
1
2 1
28
Cascaded Counters
• Counters can be connected to achieve higher modulus
operation.
29
Cascaded Counters (continue)
Asynchronous cascading
Two asynchronous counters connected in cascade for a 2 bit and a
3 bit ripple counter. The overall modulus of the two cascaded
counters is 4 x 8 = 32; that is they act as a divide-by-32 counter.
2 3
30
Cascaded Counters (continue)
Synchronous cascading
◼ In synchronous cascaded counter, it is necessary to use the count enable
(CTEN) and the terminal count (TC) functions to achieve higher modulus
operation.
◼ Terminal count (TC) is analogous to ripple clock or ripple carry out (RCO)
on some IC counters.
31
Cascaded Counters (continue)
◼ Example 1: The figure below shows a mod-10 counter
and mod-8 counter connected in cascade. What is the
overall modulus of these two cascaded counter?
Determine the frequency at B if fin is 20kHz.
Answer:
Overall modulus = 10 x 8 =80 = mod-80 counter
Frequency at B = fin/80 = 250Hz
•32
Cascaded Counters (continue)
◼ Example 2:
How many decade counters are required to convert a clock of 1
MHz to 1 Hz? Draw the circuit.
Answer: fout = fin/10n
1 = (1x106)/10n
n = log (1x106)/log10
n = 6 decade counter
33
Cascaded Counters (continue)
Answer:
(a) the overall modulus for the 3 counter configuration is 8 x 12 x 16
= 1536 = mod-1536
(b) the overall modulus for the 4 counter configuration is 10 x 4 x 7 x
5 = 1400 = mod-1400
34
Decade Counters/BCD counters
◼ Decade counter
❑ Any counter has 10 distinct states, no matter what
the sequence.
◼ BCD counter
❑ A decade counter counts in sequence from
0000(zero) through 1001(decimal 9).
35
Counter Decoding (decoding a counter)
36
Counter Decoding (decoding a counter)
Example: A 3-bit counter with active-HIGH decoding of count 2 and count 7.
0 1
1 1
0 1
37
Decoding glitches
◼ The decoding process of synchronous counter may also resort to
glitches.
◼ Due to propagation delay from the clock to the Q output of every
flip-flop
glitch
38
Example of glitches
0 1 0 1 0 1 0 1 0 1 0
0 0 1 1 0 0 1 1 0 0 0
0 0 0 0 1 1 1 1 0 0 0
0 0 0 0 0 0 0 0 1 1 0
39
Solution to eliminate glitches
◼ Strobing - enable the decoder decodes outputs at a time after the
glitches have had time to disappear.
◼ Accomplished in the case of an active high clock by using the low
level of the clock to enable the decoder.
◼ Strobing is a technique applied to circuits receiving the output of
an asynchronous (ripple) counter, so that the false counts
generated during the ripple time will have no ill effect.
❑ Essentially, the enable input of such a circuit is connected to the counter's
clock pulse in such a way that it is enabled only when the counter outputs
are not changing, and will be disabled during those periods of changing
counter outputs where ripple occurs.
40
Example without glitches
41
Exercise 1
◼ Design a 3 bit up/down counter using JK flip-flop based on the
state diagram below. Assume up = 1 and down = 0.
0
0 0
1
7 1
1
0
0
1
1
6 2
1 1
0
0
5 1
1 3
0 4 0
42
Exercise 2
43
Exercise 3
◼ Design synchronous counters that goes
through the shown states (use JK flip flops).
Assume that state 111 and 011 are unused
state. Test the unused state to not block the
system
44
Answer
45