DPSD 20-21 Notes Unit-3
DPSD 20-21 Notes Unit-3
UNIT – III
3.1 INTRODUCTION
In combinational logic circuits, the outputs at any instant of time
depend only on the input signals present at that time. For a change in input, the
output occurs immediately.
3.3 LATCHES
Latches and Flip-Flops are the basic building blocks of the most
sequential circuits. Latches are used for a sequential device that checks all of its
inputs continuously and changes its outputs accordingly at any time independent
of clocking signal. Enable signal is provided with the latch. When enable signal
is active output changes occur as the input changes. But when enable signal is not
activated input changes do not affect the output.
Flip-Flop is used for a sequential device that normally samples its inputs and
changes its outputs only at times determined by clocking signal.
3.3.1 SR Latch:
The simplest type of latch is the set-reset (SR) latch. It can be
constructed from either two NOR gates or two NAND gates.
Logic Symbol
SR latch using NOR gates
Before going to analyse the SR latch, we recall that a logic 1 at any
input of a NOR gate forces its output to a logic 0. Let us understand the operation
of this circuit for various input/ output possibilities.
Case 1: S= 0 and R= 0
Initially, Q= 1 and Q’= 0
Let us assume that initially Q=1 and Q’=0. With Q’=0, both inputs to
NOR gate 1 are at logic 0. So, its output, Q is at logic 1. With Q=1, one input of
NOR gate 2 is at logic
1. Hence its output, Q’ is at logic 0. This shows that when S and R
both are low, the output does not change.
Case 2: S= 0 and R= 1
In this case, R input of the NOR gate 1 is at logic 1, hence its
output, Q is at logic 0. Both inputs to NOR gate 2 are now at logic 0. So that its
output, Q’ is at logic 1.
Case 3: S= 1 and R= 0
In this case, S input of the NOR gate 2 is at logic 1, hence its
output, Q is at logic 0. Both inputs to NOR gate 1 are now at logic 0. So that its
output, Q is at logic 1.
Case 4: S= 1 and R= 1
When R and S both are at logic 1, they force the outputs of both
NOR gates to the low state, i.e., (Q=0 and Q’=0). So, we call this an indeterminate
or prohibited state, and represent this condition in the truth table as an asterisk
(*). This condition also violates the basic definition of a latch that requires Q to
be complement of Q’. Thus in normal operation this condition must be avoided
by making sure that 1’s are not applied to both the inputs simultaneously.
We can summarize the operation of SR latch as follows:
• When S= 0 and R= 0, the output, Qn+1 remains in its present state, Qn.
• When S= 0 and R= 1, the latch is reset to 0.
• When S= 1 and R= 0, the latch is set to 1.
• When S= 1 and R= 1, the output of both gates will produce 0. Qn+1= Qn+1’=
0.
The truth table of NOR based SR latch is shown below.
S R Qn Qn+1 State
0 0 0 0 No Change
0 0 1 1 (NC)
0 1 0 0
Reset
0 1 1 0
1 0 0 1
Set
1 0 1 1
1 1 0 x Indeterminate
1 1 1 x *
Gated SR Latch:
In the SR latch, the output changes occur immediately after the input
changes i.e, the latch is sensitive to its S and R inputs all the time.
A latch that is sensitive to the inputs only when an enable input is
active. Such a latch with enable input is known as gated SR latch.
• The circuit behaves like SR latch when EN= 1
It retains its previous state when EN= 0
3.3.2 D Latch
In SR latch, when both inputs are same (00 or 11), the output either
does not change or it is invalid. In many practical applications, these input
conditions are not required. These input conditions can be avoided by making
them complement of each other. This modified SR latch is known as D latch.
0 x x Qn No Change (NC)
As shown in the truth table, the Q output follows the D input. For this
reason, D latch is called transparent latch.
When D is HIGH and EN is HIGH. Q goes HIGH. When D is LOW
and EN is HIGH, Q goes LOW. When EN is LOW, the state of the latch is not
affected by the D input.
The S and R inputs of the S-R Flip-Flop are called synchronous inputs
because data on these inputs are transferred to the Flip-Flop's output only on the
triggering edge of the clock pulse. The circuit is similar to SR latch except enable
signal is replaced by clock pulse (CLK). On the positive edge of the clock pulse,
the circuit responds to the S and R inputs.
SR Flip-Flop
When S is HIGH and R is LOW, the Q output goes HIGH on the triggering
edge of the clock pulse, and the Flip-Flop is SET. When S is LOW and R is HIGH,
the Q output goes LOW on the triggering edge of the clock pulse, and the Flip-
Flop is RESET. When both S and R are LOW, the output does not change from
its prior state. An invalid condition exists when both S and R are HIGH.
CLK S R Qn Qn+1 State
1 0 0 0 0
No Change (NC)
1 0 0 1 1
1 0 1 0 0
Reset
1 0 1 1 0
1 1 0 0 1
Set
1 1 0 1 1
1 1 1 0 x Indeterminate
1 1 1 1 x *
0 x x 0 0
No Change (NC)
0 x x 1 1
Truth table for SR Flip-Flop
CS8351 Digital Principles and System Design 12
Unit - III Synchronous Sequential Circuits
JK Flip Flop
The data input J and the output Q’ are applied o the first AND gate and
its output (JQ’) is applied to the S input of SR Flip-Flop. Similarly, the data input
K and the output Q are applied to the second AND gate and its output (KQ) is
applied to the R input of SR Flip-Flop.
J= K= 0
When J=K= 0, both AND gates are disabled. Therefore clock pulse have no
effect, hence the Flip-Flop output is same as the previous output.
J= 0, K= 1
When J= 0 and K= 1, AND gate 1 is disabled i.e., S= 0 and R= 1. This
condition will reset the Flip-Flop to 0.
J= 1, K= 0
When J= 1 and K= 0, AND gate 2 is disabled i.e., S= 1 and R= 0. Therefore
the Flip-Flop will set on the application of a clock pulse.
J= K= 0
When J=K= 1, it is possible to set or reset the Flip-Flop. If Q is High, AND
gate 2 passes on a reset pulse to the next clock. When Q is low, AND gate 1 passes
on a set pulse to the next clock. Eitherway, Q changes to the complement of the
last state i.e., toggle. Toggle means to switch to the opposite state.
The truth table of JK Flip-Flop is given below.
Inputs Output
CLK State
J K Qn+1
1 0 0 Qn No Change
1 0 1 0 Reset
1 1 0 1 Set
1 1 1 Qn’ Toggle
Truth table for JK Flip-Flop
3.5.3 D Flip-Flop:
Like in D latch, in D Flip-Flop the basic SR Flip-Flop is used with
complemented inputs. The D Flip-Flop is similar to D-latch except clock pulse is
used instead of enable input.
D Flip-Flop
To eliminate the undesirable condition of the indeterminate state in the RS
Flip-Flop is to ensure that inputs S and R are never equal to 1 at the same time.
This is done by D Flip-Flop. The D (delay) Flip-Flop has one input called delay
input and clock pulse input. The D Flip-Flop using SR Flip-Flop is shown below.
Looking at the truth table for D Flip-Flop we can realize that Qn+1
function follows the D input at the positive going edges of the clock pulses.
Characteristic table and Characteristic equation:
The characteristic table for D Flip-Flop shows that the next state of the Flip-
Flop is independent of the present state since Qn+1 is equal to D. This means that
an input pulse will transfer the value of input D into the output of the Flip-Flop
independent of the value of the output before the pulse was applied.
The characteristic equation is derived from K-map.
Qn D Qn+1
0 0 0
0 1 1
1 0 0
1 1 1
Characteristic table
3.5.4 T Flip-Flop
The T (Toggle) Flip-Flop is a modification of the JK Flip-Flop. It is obtained
from JK Flip-Flop by connecting both inputs J and K together, i.e., single input.
Regardless of the present state, the Flip-Flop complements its output when the
clock pulse occurs while input T= 1.
T Flip-Flop
When T= 0, Qn+1= Qn, ie., the next state is the sameas the present state and
no change occurs.
When T= 1, Qn+1= Qn’,ie., the next state is the complement of the present
state.
T Qn+1 State
0 Qn No Change
1 Qn’ Toggle
Logic diagram
When the clock pulse has a positive edge, the master acts according to its
J-K inputs, but the slave does not respond, since it requires a negative edge at the
clock input.
When the clock input has a negative edge, the slave Flip-Flop copies the
master outputs. But the master does not respond since it requires a positive edge
at its clock input.
The clocked master-slave J-K Flip-Flop using NAND gates is shown below.
Master-Slave JK Flip-Flop
3.6 APPLICATION TABLE (OR) EXCITATION TABLE:
The characteristic table is useful for analysis and for defining the
operation of the Flip-Flop. It specifies the next state (Qn+1) when the inputs and
present state are known.
The excitation or application table is useful for design process. It is
used to find the Flip-Flop input conditions that will cause the required
transition, when the present state (Qn) and the next state (Qn+1) are known.
3.6.1 SR Flip-Flop:
Present Next Present Next
Inputs Inputs Inputs
State State State State
Qn S R Qn+1 Qn Qn+1 S R S R
0 0 0 0 0 0 0 0
0 x
0 0 1 0 0 0 0 1
0 1 0 1 0 1 1 0 1 0
0 1 1 x 1 0 0 1 0 1
1 0 0 1 1 1 0 0
x 0
1 0 1 0 1 1 1 0
1 1 0 1
1 1 1 x Modified Table
Characteristic Table
Present Next
Inputs
State State
Qn Qn+1 S R
0 0 0 x
0 1 1 0
1 0 0 1
1 1 x 0
Excitation Table
There are 4 possible transitions from present state to next state. The
required Input conditions for each of the four transitions are derived from the
information available in the characteristic table. The symbol ‘x’ denotes the don’t
care condition, it does not matter whether the input is 0 or 1.
3.6.2 JK Flip-Flop:
Present Next Present Next
Inputs Inputs Inputs
State State State State
Qn J K Qn+1 Qn Qn+1 J K J K
0 0 0 0 0 0 0 0
0 x
0 0 1 0 0 0 0 1
0 1 0 1 0 1 1 0
1 x
0 1 1 1 0 1 1 1
1 0 0 1 1 0 0 1
x 1
1 0 1 0 1 0 1 1
1 1 0 1 1 1 0 0
x 0
1 1 1 0 1 1 1 0
Present Next
Inputs
State State
Qn Qn+1 J K
0 0 0 x
0 1 1 x
1 0 x 1
1 1 x 0
Excitation Table
3.6.3 D Flip-Flop
3.6.4 T Flip-Flop
Present Next
Input
State State Present Next
Input
Qn T Qn+1 State State
0 0 0 Qn Qn+1 T
0 1 1 0 0 0
1 0 1 0 1 1
1 1 0 1 0 1
1 1 0
Characteristic Table
Modified Table
1 0 1 1 0
1 1 1 x 0
D Flip-Flop
3.7.2 SR Flip-Flop to JK Flip-Flop
The excitation table for the above conversion is,
Flip-Flop
Inputs Present state Next state
Input
J K Qn Qn+1 S R
0 0 0 0 0 x
0 0 1 1 x 0
0 1 0 0 0 x
0 1 1 0 0 1
1 0 0 1 1 0
1 0 1 1 x 0
1 1 0 1 1 0
1 1 1 0 0 1
JK Flip-Flop
• Mealy model: The output depends on both the present state of the Flip-
Flops and on the inputs.
3.8.1 Moore model:
In the Moore model, the outputs are a function of the present state of the
Flip-Flops only. The output depends only on present state of Flip-Flops, it appears
only after the clock pulse is applied, i.e., it varies in synchronism with the clock
input.
Moore model
3.8.2 Mealy model:
In the Mealy model, the outputs are functions of both the present state of
the Flip-Flops and inputs.
Mealy model
In case of Moore circuit, the directed lines are labeled with only one binary
number representing the state of the input that causes the state transition. The
output state is indicated within the circle, below the present state because output
state depends only on present state and not on the input.
State diagram for Mealy circuit State diagram for Moore circuit
c d c 0 1
d b d 0 0
In case of Moore circuit, the output section has only one column since
output does not depend on input.
Outpu
Next state
Present state t
X= 0 X= 1
Y
AB AB AB
a a c 0
b b a 0
c d c 1
d b d 0
4. Obtain the state table and reduced form of the state table.
5. Draw the state diagram by using the second form of the state table.
0 0 0 0 1 1 1 0 1 0
0 0 1 1 1 1 1 1 1 0
0 1 0 1 1 1 1 1 0 0
0 1 1 1 1 1 1 1 0 1
1 0 0 0 1 1 1 0 1 0
1 0 1 1 1 0 1 0 0 0
1 1 0 1 1 1 1 0 0 0
1 1 1 1 1 0 1 0 0 0
2. A sequential circuit with two ‘D’ Flip-Flops A and B, one input (x) and one
output (y). the Flip-Flop input functions are:
DA= Ax+ Bx
DB= A’x and the circuit output function is,
Y= (A+ B) x’.
(a) Draw the logic diagram of the circuit,
(b) Tabulate the state table,
(c) Draw the state diagram.
Soln:
State Table:
Present Inpu
Flip-Flop Inputs Next state Output
state t
DA= DB= Y=
A B x A(t+1) B(t+1)
Ax+Bx A’x (A+B)x’
0 0 0 0 0 0 0 0
0 0 1 0 1 0 1 0
0 1 0 0 0 0 0 1
0 1 1 1 1 1 1 0
1 0 0 0 0 0 0 1
1 0 1 1 0 1 0 0
1 1 0 0 0 0 0 1
1 1 1 1 0 1 0 0
3. Analyze the synchronous Mealy machine and obtain its state diagram.
Soln:
The given synchronous Mealy machine consists of two D Flip-Flops, one inputs
and one output.
The Flip-Flop input functions are,
DA= Y1’Y2X’
DB= X+ Y1’Y2
The circuit output function is, Z= Y1Y2X
State Table:
Present Inpu
Flip-Flop Inputs Next state Output
state t
DA= DB= X+ Y1 Y2 Z=
Y1 Y2 X
Y1’Y2X’ Y1’Y2 (t+1) (t+1) Y1Y2X
0 0 0 0 0 0 0 0
0 0 1 0 1 0 1 0
0 1 0 1 1 1 1 0
0 1 1 0 1 0 1 0
1 0 0 0 0 0 0 0
1 0 1 0 1 0 1 0
1 1 0 0 0 0 0 0
1 1 1 0 1 0 1 1
Present Next state Output
state X= 0 X= 1 X= 0 X= 1
Y1 Y2 Y1 Y2 Y1 Y2 Z Z
0 0 0 0 0 1 0 0
0 1 1 1 0 1 0 0
1 0 0 0 0 1 0 0
1 1 0 0 0 1 0 1
Second form of state table
State Diagram:
4. A sequential circuit has two JK Flop-Flops A and B, two inputs x and y and
one output z. The Flip-Flop input equation and circuit output equations are
State table:
To obtain the next-state values of a sequential circuit with JK Flip-Flop,
use the JK Flip-Flop characteristic table,
Present
Input Flip-Flop Inputs Next state Output
state
JA= KA= JB= KB=
A B x y A(t+1) B(t+1) z
Bx+B’y’ B’xy’ A’x A+xy’
0 0 0 0 1 0 0 0 1 0 0
0 0 0 1 0 0 0 0 0 0 0
0 0 1 0 1 1 1 1 1 1 0
0 0 1 1 0 0 1 0 0 1 0
0 1 0 0 0 0 0 0 0 0 1
0 1 0 1 0 0 0 0 0 0 0
0 1 1 0 1 0 1 1 1 1 0
0 1 1 1 1 0 1 0 1 1 0
1 0 0 0 1 0 0 1 1 0 1
1 0 0 1 0 0 0 1 1 0 0
1 0 1 0 1 1 0 1 0 0 0
1 0 1 1 0 0 0 1 1 0 0
1 1 0 0 0 0 0 1 1 0 1
1 1 0 1 0 0 0 1 1 0 0
1 1 1 0 1 0 0 1 1 0 0
1 1 1 1 1 0 0 1 1 0 0
State Equation:
The output function is not given in the problem. The output of the Flip-
Flops may be considered as the output of the circuit.
State table:
To obtain the next-state values of a sequential circuit with JK Flip-Flop,
use the JK Flip-Flop characteristic table.
Present Inpu
Flip-Flop Inputs Next state
state t
KA= KB=
A B x JA= B JB= x’ A(t+1) B(t+1)
Bx’ A x
0 0 0 0 0 1 0 0 1
0 0 1 0 0 0 1 0 0
0 1 0 1 1 1 0 1 1
0 1 1 1 0 0 1 1 0
1 0 0 0 0 1 1 1 1
1 0 1 0 0 0 0 1 0
1 1 0 1 1 1 1 0 0
1 1 1 1 0 0 0 1 1
Soln:
Using the assigned variable Y1 and Y2 for the two JK Flip-Flops, we can
write the four excitation input equations and the Moore output equation as
follows:
JA= Y2X ; KA= Y2’
JB= X ; KB= X’ and output function, Z= Y1Y2’
State table:
Present Inpu
Flip-Flop Inputs Next state Output
state t
JA= KA= JB= KB= Y1 Y2 Z=
Y1 Y2 X
Y2X Y2’ X X’ (t+1) (t+1) Y1Y2’
0 0 0 0 1 0 1 0 0 0
0 0 1 0 1 1 0 0 1 0
0 1 0 0 0 0 1 0 0 0
0 1 1 1 0 1 0 1 1 0
1 0 0 0 1 0 1 0 0 1
1 0 1 0 1 1 0 0 1 1
1 1 0 0 0 0 1 1 0 0
1 1 1 1 0 1 0 1 1 0
State Diagram:
Here the output depends on the present state only and is independent of the
input. The two values inside each circle separated by a slash are for the present
state and output.
State table
Present Inpu
Flip-Flop Inputs Next state Output
state t
A B x TA= Bx TB= x A (t+1) B (t+1) y= AB
0 0 0 0 0 0 0 0
0 0 1 0 1 0 1 0
0 1 0 0 0 0 1 0
0 1 1 1 1 1 0 0
1 0 0 0 0 1 0 0
1 0 1 0 1 1 1 0
1 1 0 0 0 1 1 1
1 1 1 1 1 0 0 1
1 1 1 1 0 0 1 1
Second form of state table
State Diagram:
State diagram
CS8351 Digital Principles and System Design 47
Unit - III Synchronous Sequential Circuits
Soln:
From the above state table e and g generate exactly same next state and
same output for every possible set of inputs. The state e and g go to next states a
and f and have outputs 0 and 1 for x=0 and x=1 respectively. Therefore state g
can be removed and replaced by e. The reduced state table-1 is shown below.
a a b 0 0
b c d 0 0
c a d 0 0
d e f 0 1
e a f 0 1
f e f 0 1
Next state
Present state
X= 0 X= 1
1 1, 0 1, 0
2 1, 1 6, 1
3 4, 0 5, 0
4 1, 1 7, 0
5 2, 0 3, 0
6 4, 0 5, 0
7 2, 0 3, 0
Soln:
Next state Output
Present state
X= 0 X= 1 X= 0 X= 1
1 1 1 0 0
2 1 6 1 1
3 4 5 0 0
4 1 7 1 0
5 2 3 0 0
6 4 5 0 0
7 2 3 0 0
From the above state table, 5 and 7 generate exactly same next state and
same output for every possible set of inputs. The state 5 and 7 go to next states 2
and 3 and have outputs 0 and 0 for x=0 and x=1 respectively. Therefore state 7
can be removed and replaced by 5.
Similarly, 3 and 6 generate exactly same next state and same output for
every possible set of inputs. The state 3 and 6 go to next states 4 and 5 and have
outputs 0 and 0 for x=0 and x=1 respectively. Therefore state 6 can be removed
and replaced by 3.
The final reduced state table is shown below.
Next state Output
Present state
X= 0 X= 1 X= 0 X= 1
1 1 1 0 0
2 1 3 1 1
3 4 5 0 0
4 1 5 1 0
5 2 3 0 0
Reduced state table
Thus 7 states are reduced into 5 states.
3. Minimize the following state table.
Next state
Present state
X= 0 X= 1
A D, 0 C, 1
B E, 1 A, 1
C H, 1 D, 1
D D, 0 C, 1
E B, 0 G, 1
F H, 1 D, 1
G A, 0 F, 1
H C, 0 A, 1
I G, 1 H,1
Soln:
Next state Output
Present state
X= 0 X= 1 X= 0 X= 1
A D C 0 1
B E A 1 1
C H D 1 1
D D C 0 1
E B G 0 1
F H D 1 1
G A F 0 1
H C A 0 1
I G H 1 1
From the above state table, A and D generate exactly same next state and
same output for every possible set of inputs. The state A and D go to next states
D and C and have outputs 0 and 1 for x=0 and x=1 respectively. Therefore state
D can be removed and replaced by A. Similarly, C and F generate exactly
same next state and same output for every possible set of inputs. The state C
and F go to next states H and D and have outputs 1 and 1 for x=0 and x=1
respectively. Therefore state F can be removed and replaced by C.
Therefore state G can be removed and replaced by A. The final reduced state
table-2 is shown below.
Next state Output
Present state
X= 0 X= 1 X= 0 X= 1
A A C 0 1
B E A 1 1
C H A 1 1
E B A 0 1
H C A 0 1
I A H 1 1
Reduced state table-2
Thus 9 states are reduced into 6 states.
Soln:
Next state Output
Present state
X= 0 X= 1 X= 0 X= 1
a a b 0 0
b c d 0 0
c a d 0 0
d e f 0 1
e a f 0 1
f g f 0 1
g a f 0 1
State table
From the above state table e and g generate exactly same next state and
same output for every possible set of inputs. The state e and g go to next states a
and f and have outputs 0 and 1 for x=0 and x=1 respectively. Therefore state g
can be removed and replaced by e. The reduced state table-1 is shown below.
X= 0 X= 1 X= 0 X= 1
a a b 0 0
b c d 0 0
c a d 0 0
d e d 0 1
e a d 0 1
Reduced state table-2
Thus 7 states are reduced into 5 states.
The state diagram for the reduced state table-2 is,
Present Next
Inputs
State State Excitation table for JK Flip-Flop
Qn Qn+1 S R
0 0 0 x Present Next
Input
0 1 1 0 State State
1 0 0 1 Qn Qn+1 T
1 1 x 0 0 0 0
0 1 1
Excitation table for SR Flip-Flop 1 0 1
1 1 0
Present Next
Inputs
State State Excitation table for T Flip-Flop
Qn Qn+1 J K
0 0 0 x
0 1 1 x Present Next
Input
1 0 x 1 State State
1 1 x 0 Qn Qn+1 D
0 0 0
0 1 1
1 0 0
1 1 1
3.11.3 Problems
1. A sequential circuit has one input and one output. The state diagram is shown
below. Design the sequential circuit with a) D-Flip-Flops, b) T Flip-Flops, c) RS
Flip-Flops and d) JK Flip-Flops.
Solution:
State Table:
The state table for the state diagram is,
State reduction:
As seen from the state table there is no equivalent states. Therefore, no
reduction in the state diagram.
The state table shows that circuit goes through four states, therefore we
require 2 Flip-Flops (number of states= 2m, where m= number of Flip-Flops). Since
two Flip-Flops are required first is denoted as A and second is denoted as B.
Present Flip-Flop
Input Next state Output
state Inputs
A B X A B DA DB Y
0 0 0 0 0 0 0 0
0 0 1 1 0 1 0 1
0 1 0 1 1 1 1 0
0 1 1 0 0 0 0 0
1 0 0 1 0 1 0 1
1 0 1 0 1 0 1 0
1 1 0 0 0 0 0 1
1 1 1 1 0 1 0 0
Circuit excitation table
K-map Simplification:
With these Flip-Flop input functions and circuit output function we can draw
the logic diagram as follows.
Present Flip-Flop
Input Next state Output
state Inputs
A B X A B TA TB Y
0 0 0 0 0 0 0 0
0 0 1 1 0 1 0 1
0 1 0 1 1 1 0 0
0 1 1 0 0 0 1 0
1 0 0 1 0 0 0 1
1 0 1 0 1 1 1 0
1 1 0 0 0 1 1 1
1 1 1 1 0 0 1 0
Circuit excitation table
K-map Simplification:
TA= B x and
With these Flip-Flop input functions and circuit output function we can draw
the logic diagram as follows.
Present
Input Next state Flip-Flop Inputs Output
state
A B X A B SA RA SB RB Y
0 0 0 0 0 0 X 0 x 0
0 0 1 1 0 1 0 0 x 1
0 1 0 1 1 1 0 x 0 0
0 1 1 0 0 0 X 0 1 0
1 0 0 1 0 X 0 0 x 1
1 0 1 0 1 0 1 1 0 0
1 1 0 0 0 0 1 0 1 1
1 1 1 1 0 X 0 0 1 0
Circuit excitation table
K-map Simplification:
With these Flip-Flop input functions and circuit output function we can draw
the logic diagram as follows.
Qn Qn+1 J K
0 0 0 x
0 1 1 x
1 0 x 1
1 1 x 0
Excitation table for JK Flip-Flop
Present
Input Next state Flip-Flop Inputs Output
state
A B X A B JA KA JB KB Y
0 0 0 0 0 0 x 0 x 0
0 0 1 1 0 1 x 0 x 1
0 1 0 1 1 1 x x 0 0
0 1 1 0 0 0 x x 1 0
1 0 0 1 0 x 0 0 x 1
1 0 1 0 1 x 1 1 x 0
1 1 0 0 0 x 1 x 1 1
1 1 1 1 0 x 0 x 1 0
Circuit excitation table
K-map Simplification:
2. Design a clocked sequential machine using JK Flip-Flops for the state diagram
shown in the figure. Use state reduction if possible. Make proper state
assignment.
Soln:
State Table:
Next state Output
Present state
X= 0 X= 1 X= 0 X= 1
a a b 0 0
b c b 0 0
c a b 0 1
d a b 0 0
From the above state table a and d generate exactly same next state and
same output for every possible set of inputs. The state a and d go to next states a
and b and have outputs 0 and 0 for x=0 and x=1 respectively. Therefore state d can
be removed and replaced by a. The final reduced state table is shown below.
Next state Output
Present state
X= 0 X= 1 X= 0 X= 1
a a b 0 0
b c b 0 0
c a b 0 1
Reduced State table
CS8351 Digital Principles and System Design 71
Unit - III Synchronous Sequential Circuits
Binary Assignment:
Now each state is assigned with binary values. Since there are three states,
number of Flip-Flops required is two and 2 binary numbers are assigned to the
states. a= 00; b= 0; and c= 10
The reduced state diagram is drawn as,
Present
Input Next state Flip-Flop Inputs Output
state
X A B A B JA KA JB KB Y
0 0 0 0 0 0 x 0 x 0
1 0 0 0 1 0 x 1 x 0
0 0 1 1 0 1 x x 1 0
1 0 1 0 1 0 x x 0 0
0 1 0 0 0 x 1 0 x 0
1 1 0 0 1 x 1 1 x 1
0 1 1 x x x x x x x
1 1 1 x x x x x x x
K-map Simplification:
With these Flip-Flop input functions and circuit output function we can draw
the logic diagram as follows.
3. Design a clocked sequential machine using T Flip-Flops for the following state
diagram. Use state reduction if possible. Also use straight binary state
assignment.
Soln:
State Table:
State table for the given state diagram is,
a a b 0 0
b d c 0 0
c a b 1 0
d b a 1 1
Even though a and c are having same next states for input X=0 and X=1, as
the outputs are not same state reduction is not possible.
State Assignment:
Use straight binary assignments as a= 00, b= 01, c= 10 and d= 11, the
transition table is,
Present Flip-Flop
Input Next state Output
state Inputs
X A B A B TA TB Y
0 0 0 0 0 0 0 0
0 0 1 1 1 1 0 0
0 1 0 0 0 1 0 1
0 1 1 0 1 1 0 1
1 0 0 0 1 0 1 0
1 0 1 1 0 1 1 0
1 1 0 0 1 1 1 0
1 1 1 0 0 1 1 1
K-map simplification:
Logic Diagram:
Rule 2:
States that are the NEXT STATES of a single state should have assignment
which can be grouped into logically adjacent cells in a K-map.
1 0 1 0 x x x x
1 0 1 1 x x x x
1 1 0 0 x x x x
1 1 0 1 x x x x
1 1 1 0 x x x x
1 1 1 1 x x x x
K-map Simplification:
----------------------------------------
12 gates with 31 inputs
Now, we will apply the state assignment rules and compare the results.
1 0 0 1 x x x x
1 0 1 0 0 0 0 0
1 0 1 1 0 0 0 1
1 1 0 0 x x x x
1 1 0 1 x x x x
1 1 1 0 0 0 0 1
1 1 1 1 0 0 0 0
K-map Simplification:
Thus by simply applying Rules 1 and 2 good results have been achieved.
There are two ways to shift into a register (serial or parallel) and similarly two
ways to shift the data out of the register. This leads to the construction of four basic
register types—
CS8351 Digital Principles and System Design 82
Unit - III Synchronous Sequential Circuits
(i) Serial in- serial out (iii) Parallel in- serial out
(iii) Serial in- parallel out (iv) Parallel in- parallel out
The entry of the four bits 1010 into the register is illustrated below, beginning
with the right-most bit. The register is initially clear. The 0 is put onto the data input
line, making D=0 for FF0. When the first clock pulse is applied, FF0 is reset, thus
storing the 0.
Next the second bit, which is a 1, is applied to the data input, making D=1 for
FF0 and D=0 for FF1 because the D input of FF1 is connected to the Q0 output. When
the second clock pulse occurs, the 1 on the data input is shifted into FF0, causing
FF0 to set; and the 0 that was in FF0 is shifted into FFl.
The third bit, a 0, is now put onto the data-input line, and a clock pulse is
applied. The 0 is entered into FF0, the 1 stored in FF0 is shifted into FFl, and the 0
stored in FF1 is shifted into FF2.
The last bit, a 1, is now applied to the data input, and a clock pulse is applied.
This time the 1 is entered into FF0, the 0 stored in FF0 is shifted into FFl, the 1
stored in FF1 is shifted into FF2, and the 0 stored in FF2 is shifted into FF3. This
completes the serial entry of the four bits into the shift register, where they can be
stored for any length of time as long as the Flip-Flops have dc power.
Four bits (1010) being entered serially-shifted out of the register and replaced
by all zeros
When SHIFT/LOAD is LOW, gates G1, G2, G3 and G4 are enabled, allowing
each data bit to be applied to the D input of its respective Flip-Flop. When a clock
pulse is applied, the Flip-Flops with D = 1 will set and those with D = 0 will reset,
thereby storing all four bits simultaneously.
When SHIFT/LOAD is HIGH, gates G1, G2, G3 and G4 are disabled and gates
G5, G6 and G7 are enabled, allowing the data bits to shift right from one stage to the
next. The OR gates allow either the normal shifting operation or the parallel data-
entry operation, depending on which AND gates are enabled by the level on the
SHIFT/LOAD input.
4. A shift-left control to enable the shift left operation and the serial input and
output lines associated with the shift left.
5. A parallel-load control to enable a parallel transfer and the n input lines
associated with the parallel transfer.
6. n parallel output lines.
7. A control line that leaves the information in the register unchanged even
though the clock pulses re continuously applied.
When the RIGHT/LEFT control input is LOW, gates G5, G6, G7 and G8 are
enabled, and the Q output of each Flip-Flop is passed through to the D input of the
preceding Flip-Flop. When a clock pulse occurs, the data bits are then shifted one
place to the left.
The term ‘synchronous’ refers to events that have a fixed time relationship
with each other. In synchronous counter, the clock pulses are applied to all Flip-
Flops simultaneously. Hence there is minimum propagation delay.
Asynchronous (ripple)
S.No Synchronous counter
counter
1 All the Flip-Flops are not All the Flip-Flops are clocked
clocked simultaneously. simultaneously.
2 The delay times of all Flip- There is minimum propagation
Flops are added. Therefore delay.
there is considerable
propagation delay.
3 Speed of operation is low Speed of operation is high.
4 Logic circuit is very simple Design involves complex logic
even for more number of circuit as number of state increases.
states.
5 Minimum numbers of logic The number of logic devices is more
devices are needed. than ripple counters.
6 Cheaper than synchronous Costlier than ripple counters.
counters.
Timing diagram
CS8351 Digital Principles and System Design 96
Unit - III Synchronous Sequential Circuits
CLOCK Pulse Q2 Q1 Q0
Initially
0 0 0
1
0 0 1
2
0 1 0
3
0 1 1
4
1 0 0
5
1 0 1
6
1 1 0
7
1 1 1
8
0 0 0
(recycles)
Timing diagram
Timing diagram
CLOCK Pulse Q3 Q2 Q1 Q0
Initially
0 0 0 0
1
0 0 0 1
2
0 0 1 0
3
0 0 1 1
4
0 1 0 0
5
0 1 0 1
6
0 1 1 0
7
0 1 1 1
8
1 0 0 0
9
1 0 0 1
0 0 0 0
10(recycles)
• First, notice that FF0 (Q0) toggles on each clock pulse, so the logic equation
for its J0 and K0 inputs is
J0= K0= 1
This equation is implemented by connecting J0 and K0 to a constant HIGH level.
• Next, notice from table, that FF1 (Q1) changes on the next clock pulse each
time Q0 = 1 and Q3 = 0, so the logic equation for the J1 and K1 inputs is
J1= K1= Q0Q3’
This equation is implemented by ANDing Q0 and Q3 and connecting the gate output
to the J1 and K1 inputs of FFl.
• Flip-Flop 2 (Q2) changes on the next clock pulse each time both Q0 = Q1 = 1.
This requires an input logic equation as follows:
Timing diagram
When UP/DOWN= 1, it will enable AND gates 1 and 3 and disable AND
gates 2 and 4. This allows the Q0 and Q1 outputs through the AND gates to the J
and K inputs of the following Flip-Flops, so the counter counts up as pulses are
applied.
When UP/DOWN= 0, the reverse action takes place.
3.14.6 MODULUS-N-COUNTERS
The counter with ‘n’ Flip-Flops has maximum MOD number 2n. Find the
number of Flip-Flops (n) required for the desired MOD number (N) using the
equation,
2n ≥ N
(i) For example, a 3 bit binary counter is a MOD 8 counter. The basic counter
can be modified to produce MOD numbers less than 2n by allowing the
counter to skin those are normally part of counting sequence.
n= 3
N= 8
2n = 23= 8= N
1. Find the number of Flip-Flops (n) required for the desired MOD number (N)
using the equation,
2n ≥ N.
2. Connect all the Flip-Flops as a required counter.
3. Find the binary number for N.
4. Connect all Flip-Flop outputs for which Q= 1 when the count is N, as inputs to
NAND gate.
5. Connect the NAND gate output to the CLR input of each Flip-Flop.
When the counter reaches Nth state, the output of the NAND gate goes LOW,
resetting all Flip-Flops to 0. Therefore the counter counts from 0 through N-1.
Timing diagram
Propagation Delay
Asynchronous counters are commonly referred to as “ripple counters” for
the following reason:
The effect of the input clock pulse is first '"felt" by FF0. This effect cannot get
to FF1 immediately because of the propagation delay through FF0. Then there is the
propagation delay through FF1 before FF2 can be triggered. Thus, the effect of an
input clock pulse "ripples" through the counter taking some time, due to propagation
delays, to reach the last Flip-Flop.
The figure below shows the ripple clocking effect for the first four clock
pulses, with the propagation delay indicated. The propagation delay of the first stage
is added in the propagation delay of second stage to decide the transition time for
the third stage.
The cumulative delay of an asynchronous counter is a major disadvantage in
many applications because it limits the rate at which the counter can be clocked and
creates decoding problems.
Propagation delays
24 ≥ 10
N= 4= Number of Flip-Flops
Counters with 10 states in their sequence are called decade counters. A decade
counter with a count sequence of zero (0000) through nine (1001) is a BCD decade
counter because its ten-state sequence produces the BCD code. This type of counter
is useful in display applications in which BCD is required for conversion to a
decimal readout.
To obtain a truncated sequence, it is necessary to force the counter to recycle
before going through all of its possible states. For example, the BCD decade counter
must recycle back to the 0000 state after the 100l state. A decade counter requires
four Flip-Flops (three Flip-Flops are insufficient because 23 = 8).
One way to make the counter recycle after the count of nine (1001) is to
decode count ten (l010) with a NAND gate and connect the output of the NAND
gate to the clear (CLR) inputs of the Flip-Flops.
CS8351 Digital Principles and System Design 111
Unit - III Synchronous Sequential Circuits
Partial Decoding
Notice in Figure that only Q1 and Q3 are connected to the NAND gate inputs.
This arrangement is an example of partial decoding, in which the two unique states
(Q1 = 1 and Q3 = 1) are sufficient to decode the count of ten because none of the
other states (zero through nine) have both Q1 and Q3, HIGH at the same time. When
the counter goes into count ten (1010), the decoding gate output goes LOW and
asynchronously resets all the Flip-Flops.
Timing Diagram
3.16 SHIFT REGISTER COUNTERS:
A shift register counter is basically a shift register with the serial output
connected back to the serial input to produce special sequences. Two of the most
common types of shift register counters are:
Johnson counter (Shift Counter),
Ring counter,
The Q output of each stage is connected to the D input of the next stage
(assuming that D Flip-Flops are used). The complement output of the last stage is
connected back to the D input of the first stage.
Ring counter
The output Q0 sets D1 input, Q1 sets D2, Q2 sets D3 and Q3 is fed back to D0.
Because of these conditions, bits are shifted left one position per positive clock edge
and fed back to the input. All the Flip-Flops are clocked together. When CLR goes
low then back to high, the output is 0000.
The first positive clock edge shifts MSB to LSB position and other bits to one
position left so that the output becomes Q= 0010. This process continues on second
and third clock edge so that successive outputs are 0100 and 1000. The fourth
positive clock edge starts the cycle all over again and the output is 0001. Thus the
stored 1 bit follows a circular path (i.e., the stored 1 bits move left through all Flip-
Flops and the final Flip-Flop sends it back to the first Flip-Flop). This action has
given the name of ring counter.
State Table:
Present State Next State
00 01
01 10
10 00
Present
Next State Flip-Flop Inputs
State
QB QA QB+1 QA+1 JB KB JA KA
0 0 0 1 0 x 1 x
0 1 1 0 1 x x 1
1 0 0 0 x 1 0 x
K-map Simplification:
Logic Diagram:
State Table:
Present State Next State
00 01
01 10
10 11
11 00
Logic Diagram:
State Table:
CS8351 Digital Principles and System Design 122
Unit - III Synchronous Sequential Circuits
1 1 0 0 0 0 x 1 x 1 0 x
K-map Simplification:
Logic Diagram:
State Table:
State Table:
Present State Next State
0000 0001
0001 0010
0010 0011
0011 0100
0100 0101
0101 0110
0110 0111
0111 1000
1000 1001
1001 0000
0 0 0 0 0 0 0 1 0 x 0 x 0 x 1 x
0 0 0 1 0 0 1 0 0 x 0 x 1 x x 1
0 0 1 0 0 0 1 1 0 x 0 x x 0 1 x
0 0 1 1 0 1 0 0 0 x 1 x x 1 x 1
0 1 0 0 0 1 0 1 0 x x 0 0 x 1 x
0 1 0 1 0 1 1 0 0 x x 0 1 x x 1
0 1 1 0 0 1 1 1 0 x x 0 x 0 1 x
0 1 1 1 1 0 0 0 1 x x 1 x 1 x 1
1 0 0 0 1 0 0 1 x 0 0 x 0 x 1 x
1 0 0 1 0 0 0 0 x 1 0 x 0 x x 1
K-map Simplification:
Logic Diagram:
6. Design a synchronous 3-bit gray code up counter with the help of excitation
table.
Soln:
Gray code sequence: 000, 001, 011, 010, 110, 111, 101, 100.
State Diagram:
State Table:
Present State Next State
000 001
001 011
011 010
010 110
110 111
111 101
101 100
100 000
Logic Diagram:
State Table:
Control Input
Present State Next State
UP/DOWN
0 000 111
0 111 110
0 110 101
0 101 100
0 100 011
0 011 010
0 010 001
0 001 000
1 000 001
1 001 010
1 010 011
1 011 100
1 100 101
1 101 110
1 110 111
1 111 000
Excitation Table:
Input Present State Next State A B C
Up/Down QA QB QC QA+1 QB+1 QC+1 JA KA JB KB JC KC
0 0 0 0 1 1 1 1 x 1 x 1 x
0 1 1 1 1 1 0 x 0 x 0 x 1
0 1 1 0 1 0 1 x 0 x 1 1 x
0 1 0 1 1 0 0 x 0 0 x x 1
0 1 0 0 0 1 1 x 1 1 x 1 x
0 0 1 1 0 1 0 0 x x 0 x 1
0 0 1 0 0 0 1 0 x x 1 1 x
0 0 0 1 0 0 0 0 x 0 x x 1
1 0 0 0 0 0 1 0 x 0 x 1 x
1 0 0 1 0 1 0 0 x 1 x x 1
1 0 1 0 0 1 1 0 x x 0 1 x
1 0 1 1 1 0 0 1 x x 1 x 1
1 1 0 0 1 0 1 x 0 0 x 1 x
1 1 0 1 1 1 0 x 0 1 x x 1
1 1 1 0 1 1 1 x 0 x 0 1 x
1 1 1 1 0 0 0 x 1 x 1 x 1
K-map Simplification
Circuit Diagram:
LOCKOUT CONDITION
In a counter if the next state of some unused state is again a used state
and if by chance the counter happens to find itself in the unused states and never
arrived at a used state then the counter is said to be in the lockout condition.
Desired Sequence
The circuit that goes in lockout condition is called bushless circuit. To make
sure that the counter will come to the initial state from any unused state, the
additional logic circuit is necessary. To ensure that the lockout does not occur, the
counter should be designed by forcing the next state to be the initial state from the
unused states as shown below.
Here, states 5, 2 and 0 are forced are forced to go into 6, 3 and 1state,
respectively to avoid lockout condition.
State Excitation table:
Present State Next State Flip-Flop Inputs
QA QB QC QA+1 QB+1 QC+1 JA KA JB KB JC KC
0 0 0 0 0 1 0 x 0 x 1 x
0 0 1 1 0 0 1 x 0 x x 1
0 1 0 0 1 1 0 x x 0 1 x
0 1 1 0 0 1 0 x x 1 x 0
1 0 0 1 1 0 x 0 1 x 0 x
1 0 1 1 1 0 x 0 1 x x 1
1 1 0 1 1 1 x 0 x 0 1 x
1 1 1 0 1 1 x 1 x 0 x 0
K-map Simplification:
Logic Diagram: