Counter Design
Counter Design
D D
CLK CLK CLK
CLK
1 0 0 1
1 1 Ø 0
JK- Flip Flop
• JK Flip-Flop is similar to SR the only
difference here is J = K = 1 is allowed.
• When J = k = 1 , the flip-flop
complements its state.
J K Qn J Pr Q
0 0 Qn-1 JK-FF
0 1 0 Clk
1 0 1 K Clr Q’
1 1 Q’n-1
JK Flip-Flop
J K Qn-1 Qn
0 0 0 0 JK
0 0 1 1 00 01 11 10
Qn-1
0 1 0 0 0 1 1
0 1 1 0
1 1 0 1
1 0 0 1
1 0 1 1
1 1 0 1 Qn =JQ’n-1 + K’Qn-1
1 1 1 0
JK Flip-Flop
Excitaion Table
Qn Qn-1 J K JK FF can used as 2, one inputs Flip-flops
O 0 0 Ø D FF: T FF:
JK always same JK never same
0 1 1 Ø
D Qn-1 Qn T Qn-1 Qn
1 0 Ø 1 0 0 0 0 0 0
0 1 0 0 1 1
1 1 Ø 0 1 0 1 1 0 1
• 1 1 1 1 0
Qn = D Qn = T +Q
• D-FF T-FF
D J T J
K K
Counter Design
• Counter is used to provide accurate timing clocks or
gating signals.
• It is a closed state sequential machine. The number of
states in closed loop gives the Modulas or Division
factor.
Ex: A Mod- 7 counter contains 7 states in closed loop
and divides external clock frequency by a factor 7
• When counter Mod –m and Mod –n are cascaded the
resultant Modulas of the counter is m*n
• The number of Flip-flops needed for Mod- N counter is
Log2N
Counter Design
Procedure:
2. Obtain Sate diagram of the counter
3. Get the Sate Table
4. Identify the Flip flop to be used for design
and get its excitation Table
4. Using the excitation table replace the next state
of the Sate table using the excitation table.
5. Obtain the expression for the inputs of given
Flip-flop and realize them
MOD 4 Gray counter using JK-FF
Step 2
Step 1
State Table
qa qb PS NS
Q1 Q0 Q1n Q0n
(qa)0 0 0 1
(qb)0 1 1 1
qd qc
(qc)1 1 1 0
(qd)1 0 0 0
MOD 4 Gray Counter
PS NS FF1 FF2
Step 3
Q1 Q 0 Q1n Q0n J1 K1 J2 K2
Excitation Table:
(qa)0 0 0 1 0 ø 1 ø
Qn Qn-1 J K
0 0 0 ø (qb)0 1 1 1 1 ø ø 0
0 1 1 ø (qc)1 1 1 0 ø 0 ø 1
5 0 ø 1 (qd)1 0 0 0 ø 1 0 ø
1 1 ø 0 J1 = Q0 ,K1 = Q’0
J0=Q’1 , K0= Q1
Realization of MOD-4 Gray counter
J0 Q0 J1 Q1
K0 Q’0 K1 Q’1
• Realize Mod- 4 Gray Counter using D-Flip
Flops. ( D1 = Q1n = Q0 , D0 = Q0n = Q’1)
• Realize Mod – 4 Gray Counter using T-
Flip Flops. ( T1= Q1 + Q0 ,T0 = Q1 Q0 )