DLC Unit 3
DLC Unit 3
UNIT III
SYNCHRONOUS SEQUENTIAL CIRCUITS
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.
Thus in sequential circuits, the output variables depend not only on the present
input variables but also on the past history of input variables.
The rotary channel selected knob on an old-fashioned TV is like a
combinational. Its output selects a channel based only on its current input – the
1
2020-21 EE8351 Digital Logic Circuits Unit III
position of the knob. The channel-up and channel-down push buttons on a TV is like
a sequential circuit. The channel selection depends on the past sequence of up/down
pushes.
2
2020-21 EE8351 Digital Logic Circuits Unit III
bit information.
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.
3
2020-21 EE8351 Digital Logic Circuits Unit III
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.
4
2020-21 CS8351 Digital Principles and System Design Unit III
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.
i.e., Qn+1= Qn+1’= 0.
5
2020-21 CS8351 Digital Principles and System Design Unit III
Truth Table of SR latch using NOR gates
S R Qn Qn+1 State
0 0 0 0
No Change (NC)
0 0 1 1
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 *
x x 0 0
No Change (NC)
x x 1 1
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
6
2020-21 CS8351 Digital Principles and System Design Unit III
When S is HIGH and R is LOW, a HIGH on the EN input sets the latch. When S is
LOW and R is HIGH, a HIGH on the EN input resets the latch.
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.
7
2020-21 CS8351 Digital Principles and System Design Unit III
As shown in the figure, D input goes directly to the S input, and its complement
is applied to the R input. Therefore, only two input conditions exists, either S=0 and
R=1 or S=1 and R=0. The truth table for D latch is shown below.
EN D Qn Qn+1 State
1 0 x 0 Reset
1 1 x 1 Set
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.
Flip-Flops are different from latches. Flip-Flops are pulse or clock edge
triggered instead of level triggered.
Flip-Flops are synchronous bistable devices (has two outputs Q and Q’). In this
case, the term synchronous means that the output changes state only at a specified
point on the triggering input called the clock (CLK), i.e., changes in the output occur
in synchronization with the clock.
An edge-triggered Flip-Flop changes state either at the positive edge (rising
edge) or at the negative edge (falling edge) of the clock pulse and is sensitive to its
inputs only at this transition of the clock. The different types of edge-triggered Flip-
Flops are—
• S-R Flip-Flop,
• J-K Flip-Flop,
• D Flip-Flop,
• T Flip-Flop.
Although the S-R Flip-Flop is not available in IC form, it is the basis for the D
and J-K Flip-Flops. Each type can be either positive edge-triggered (no bubble at C
Prepared By KAVIARASAN.S / Asst.Prof., PIT
input) or negative edge-triggered (bubble at C input). The key to identifying an edge-
triggered Flip-Flop by its logic symbol is the small triangle inside the block at the clock
(C) input. This triangle is called the dynamic input indicator.
9
2020-21 CS8351 Digital Principles and System Design Unit III
3.5.1 S-R Flip-Flop
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.
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.
10
2020-21 CS8351 Digital Principles and System Design Unit III
Characteristic Equation
Qn+1 = S + R’Qn
11
2020-21 CS8351 Digital Principles and System Design Unit III
JK means Jack Kilby, Texas Instrument (TI) Engineer, who invented IC in 1958.
JK Flip-Flop has two inputs J(set) and K(reset). A JK Flip-Flop can be obtained fromthe
clocked SR Flip-Flop by augmenting two AND gates as shown below.
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
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.
12
2020-21 CS8351 Digital Principles and System Design Unit III
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 Q n’ Toggle
3.5.3 D Flip-Flop:
13
2020-21 CS8351 Digital Principles and System Design Unit III
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
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.
15
2020-21 CS8351 Digital Principles and System Design Unit III
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.
16
2020-21 CS8351 Digital Principles and System Design Unit III
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.
Present Next
Inputs The clocked master-slave J-K Flip-Flop using NAND
State State gates is shown below.
Q Qn+ S R
n 1
Master-Slave JK Flip-Flop
0 0 0 x
0 1 1 0
1 0 0 1
1 1 x 0
3.6.1 SR Flip-Flop:
SR flipflop
Excitation Table
18
2020-21 CS8351 Digital Principles and System Design Unit III
The above table presents the excitation table for SR Flip-Flop. It consists of
present state (Qn), next state (Qn+1) and a column for each input to show how the
required transition is achieved.
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.
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
19
2020-21 CS8351 Digital Principles and System Design Unit III
Present Next
Inputs
State State
Q Qn+ J K
n 1
0 0 0 x
0 1 1 x
1 0 x 1
1 1 x 0
Excitation Table
D Flip-Flop
20
2020-21 CS8351 Digital Principles and System Design Unit III
3.6.2 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
21
2020-21 CS8351 Digital Principles and System Design Unit III
D Flip-Flop
22
2020-21 CS8351 Digital Principles and System Design Unit III
JK Flip-Flop
23
2020-21 CS8351 Digital Principles and System Design Unit III
Flip-Flop
Input Present state Next state
Inputs
D Qn Qn+1 J K
0 0 0 0 x
0 1 0 x 1
1 0 1 1 x
1 1 1 x 0
D Flip-Flop to T Flip-Flop
The excitation table for the above conversion is
Flip-Flop
Input Present state Next state
Input
T Qn Qn+1 D
0 0 0 0
0 1 1 1
1 0 1 1
1 1 0 0
24
2020-21 CS8351 Digital Principles and System Design Unit III
Flip-Flop
Input Present state Next state
Input
D Qn Qn+1 T
0 0 0 0
0 1 0 1
1 0 1 1
1 1 1 0
Moore model
25
2020-21 CS8351 Digital Principles and System Design Unit III
Mealy model
A directed line connecting a circle with circle with itself indicates that next state
is same as present state.
The binary number inside each circle identifies the state represented by the
circle.
The directed lines are labeled with two binary numbers separated by a symbol
‘/’. The input value that causes the state transition is labeled first and the
output value during the present state is labeled after the symbol ‘/’.
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
27
2020-21 CS8351 Digital Principles and System Design Unit III
X= 0 X= 1 X= 0 X= 1
Present state
AB AB AB Y Y
a a c 0 0
b b a 0 0
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.
Next state Output
Present state
X= 0 X= 1
Y
AB AB AB
a a c 0
b b a 0
c d c 1
d b d 0
1. A sequential circuit has two JK Flip-Flops A and B, one input (x) and one output
(y). the Flip-Flop input functions are,
JA= B+ x JB= A’+ x’
KA= 1 KB = 1
and the circuit output function, Y= xA’B.
a) Draw the logic diagram of the Mealy circuit,
b) Tabulate the state table,
c) Draw the state diagram.
Soln:
State table:
To obtain the next-state values of a sequential circuit with JK Flip-Flops, use
the JK Flip-Flop characteristics table.
Characteristic equation of JK Flipflop Qn+1= JQn’+ K’Qn
For A Flipflop A(t+1)=JAA’+KA’A
For B Flipflop B(t+1)=JBB’+KB’B
Present state Input Flip-Flop Inputs Next state Output
JA= B+ x KA= 1 JB= A’+ x’ K B= 1
A B x A(t+1) B(t+1) Y= xA’B
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
29
2020-21 CS8351 Digital Principles and System Design Unit III
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:
30
2020-21 CS8351 Digital Principles and System Design Unit III
State Table:
Characteristic equation of D flipflop Qn+1= D
A(t+1)=DA B(t+1)=DB
Present state Input Flip-Flop Inputs Next state Output
DA=
A B x DB= A’x A(t+1) B(t+1) Y= (A+B)x’
Ax+Bx
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
A B A B A B Y Y
0 0 0 0 0 1 0 0
0 1 0 0 1 1 1 0
1 0 0 0 1 0 1 0
1 1 0 0 1 0 1 0
Second form of state table
31
2020-21 CS8351 Digital Principles and System Design Unit III
State Diagram:
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:
32
2020-21 CS8351 Digital Principles and System Design Unit III
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
JA = Bx + B' y' KA = B' xy'
JB = A' x KB = A+ xy'
z = Ax' y' + Bx' y'
33
2020-21 CS8351 Digital Principles and System Design Unit III
State table:
To obtain the next-state values of a sequential circuit with JK Flip-Flop, use the JK Flip-Flop
characteristic table,
Characteristic equation of JK Flipflop Qn+1= JQn’+ K’Qn
A(t+1)=JAA’+KA’A B(t+1)=JBB’+KB’B
Present
Input Flip-Flop Inputs Next state Output
state
JA= KA= JB = K B=
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
34
2020-21 CS8351 Digital Principles and System Design Unit III
State Equation:
5. A sequential circuit has two JK Flip-Flop A and B. the Flip-Flop input functions
are: JA= B JB= x’
KA= Bx’ KB= A x.
(a) Draw the logic diagram of the circuit,
(b) Tabulate the state table,
(c) Draw the state diagram.
Logic diagram:
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.
Characteristic equation of JK Flipflop Qn+1= JQn’+ K’Qn
A(t+1)=JAA’+KA’A B(t+1)=JBB’+KB’B
35
2020-21 CS8351 Digital Principles and System Design Unit III
Next state
Present state
X= 0 X= 1
A B A B A B
0 0 0 1 0 0
0 1 1 1 1 0
1 0 1 1 1 0
1 1 0 0 1 1
Second form of State table
State Diagram:
36
2020-21 CS8351 Digital Principles and System Design Unit III
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:
37
2020-21 CS8351 Digital Principles and System Design Unit III
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.
7. A sequential circuit has two T Flip-Flop A and B. The Flip-Flop input functions
are:
TA= Bx TB= x
y= AB
(a) Draw the logic diagram of the circuit,
(b) Tabulate the state table,
(c) Draw the state diagram.
Soln:
Logic diagram:
State table
Characteristic equation: Qn+1= TQn’+ T’Qn.
A B A B A B y y
0 0 0 0 0 1 0 0
0 1 0 1 1 0 0 0
1 0 1 0 1 1 0 0
1 1 1 1 0 0 1 1
Second form of state table
State Diagram:
39
2020-21 CS8351 Digital Principles and System Design Unit III
inputs generate exactly same output and same next state. When two states are
equivalent, one of them can be removed without altering the input-output
relationship.
Since ‘n’ Flip-Flops produced 2n state, a reduction in the number of states may
result in a reduction in the number of Flip-Flops.
The need for state reduction or state minimization is explained with one
example.
State diagram
40
2020-21 CS8351 Digital Principles and System Design Unit III
X= 0 X= 1 X= 0 X= 1
Present state
a b c 0 0
b d c 1 0
c c d 0 1
d a d 0 0
Reduced state table
The state diagram for the reduced table consists of only four states and is shown
below.
1. Reduce the number of states in the following state table and tabulate the reduced
state table.
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
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
41
2020-21 CS8351 Digital Principles and System Design Unit III
and replaced by e.
The reduced state table-1 is shown below.
Now states d and f are equivalent. Both states go to the same next state (e, f)
and have same output (0, 1). Therefore one state can be removed; f is replaced by d.
The final reduced state table-2 is shown below.
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:
42
2020-21 CS8351 Digital Principles and System Design Unit III
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
Soln:
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.
The reduced state table-1 is shown below.
44
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 G 0 1
G A C 0 1
H C A 0 1
I G H 1 1
Reduced state table-1
From the above reduced state table-1, A and G generate exactly same next state
and same output for every possible set of inputs. The state A and G go to next states
A and C and have outputs 0 and 1 for x=0 and x=1 respectively. 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.
45
Soln:
Now states d and f are equivalent. Both states go to the same next state (e, f)
and have same output (0, 1). Therefore one state can be removed; f is replaced by d.
The final reduced state table-2 is shown below.
46
Reduced state diagram
47
2020-21 CS8351 Digital Principles and System Design Unit III
Flip-Flop Application
JK General Applications
D Applications requiring transfer of
data
T (Ex: Shift Registers)
Application involving
complementation
(Ex: Binary Counters)
Excitation Tables:
Before going to the design examples for the clocked synchronous sequential
circuits we revise Flip-Flop excitation tables.
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 for SR Flip-Flop
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 for JK Flip-Flop
48
2020-21 CS8351 Digital Principles and System Design Unit III
3.10.2 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.
49
2020-21 CS8351 Digital Principles and System Design Unit III
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.
Flip-Flop
Present state Input Next state Output
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
50
2020-21 CS8351 Digital Principles and System Design Unit III
51
2020-21 CS8351 Digital Principles and System Design Unit III
With these Flip-Flop input functions and circuit output function we can draw
the logic diagram as follows.
Logic diagram of given sequential circuit using D Flip-Flop
Flip-Flop
Present state Input Next state Output
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
52
2020-21 CS8351 Digital Principles and System Design Unit III
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.
53
2020-21 CS8351 Digital Principles and System Design Unit III
Excitation table for SR Flip-Flop
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.
54
2020-21 CS8351 Digital Principles and System Design Unit III
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:
55
2020-21 CS8351 Digital Principles and System Design Unit III
56
2020-21 CS8351 Digital Principles and System Design Unit III
57
2020-21 CS8351 Digital Principles and System Design Unit III
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.
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,
58
2020-21 CS8351 Digital Principles and System Design Unit III
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:
59
2020-21 CS8351 Digital Principles and System Design Unit III
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 binary state assignment.
Soln:
State Table:
State table for the given state diagram is,
K-map simplification:
Logic Diagram:
61
2020-21 CS8351 Digital Principles and System Design Unit III
STATE ASSIGNMENT:
In sequential circuits, the behavior of the circuit is defined in terms of its inputs,
present states, next states and outputs. To generate desired next state at particular
present state and inputs, it is necessary to have specific Flip-Flop inputs. These Flip-
Flop inputs are described by a set of Boolean functions called Flip-Flop input
functions.
To determine the Flip-Flop functions, it is necessary to represent states in the
state diagram using binary values instead of alphabets. This procedure is known as
state assignment.
62
2020-21 CS8351 Digital Principles and System Design Unit III
3.15.2 State Assignment Problem:
1. Design a sequential circuit for a state diagram shown below. Use state
assignment rules for assigning states and compare the required combinational
circuit with random state assignment.
0 0 0 0 0 0 1 0
0 0 0 1 0 1 0 0
0 0 1 0 0 1 1 0
0 0 1 1 1 0 0 0
0 1 0 0 1 0 0 0
0 1 0 1 0 1 1 0
0 1 1 0 0 0 0 0
0 1 1 1 0 0 0 1
1 0 0 0 0 0 0 1
1 0 0 1 0 0 0 0
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
63
2020-21 CS8351 Digital Principles and System Design Unit III
K-map Simplification:
Now, we will apply the state assignment rules and compare the results.
K-map Simplification:
65
2020-21 CS8351 Digital Principles and System Design Unit III
The state assignments using Rule 1 and 2 require:
4 three input AND functions
1 two input AND function
2 two input OR functions
Thus by simply applying Rules 1 and 2 good results have been achieved.
66
2020-21 CS8351 Digital Principles and System Design Unit III
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 delay.
Flops are added. Therefore
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 circuit
even for more number of states. as number of state increases
5 Minimum numbers of logic The number of logic devices is more
devices are needed. than ripple counters.
Assume that the counter is initially in the binary 0 state: i.e., both Flip-Flops are
RESET. When the positive edge of the first clock pulse is applied, FF0 will toggle
because J0= k0= 1, whereas FF1 output will remain 0 because J1= k1= 0. After the first
clock pulse Q0=1 and Q1=0.
When the leading edge of CLK2 occurs, FF0 will toggle and Q0 will go LOW.
Since FF1 has a HIGH (Q0 = 1) on its J1 and K1 inputs at the triggering edge of this clock
pulse, the Flip-Flop toggles and Q1 goes HIGH. Thus, after CLK2,
Q0 = 0 and Q1 = 1.
When the leading edge of CLK3 occurs, FF0 again toggles to the SET state (Q0
= 1), and FF1 remains SET (Q1 = 1) because its J1 and K1 inputs are both LOW (Q0 = 0).
After this triggering edge, Q0 = 1 and Q1 = 1.
Finally, at the leading edge of CLK4, Q0 and Q1 go LOW because they both have
67
2020-21 CS8351 Digital Principles and System Design Unit III
a toggle condition on their J1 and K1 inputs. The counter has now recycled to its original
state, Q0 = Q1 = 0.
Timing diagram
3.14.2 3-Bit Synchronous Binary Counter
A 3 bit synchronous binary counter is constructed with three JK Flip-Flops and
an AND gate. The output of FF0 (Q0) changes on each clock pulse as the counter
progresses from its original state to its final state and then back to its original state. To
produce this operation, FF0 must be held in the toggle mode by constant HIGH, on its
J0 and K0 inputs.
The output of FF1 (Q1) goes to the opposite state following each time Q0= 1. This
change occurs at CLK2, CLK4, CLK6, and CLK8. The CLK8 pulse causes the counter
to recycle. To produce this operation, Q0 is connected to the J1 and K1 inputs of FF1.
When Q0= 1 and a clock pulse occurs, FF1 is in the toggle mode and therefore changes
state. When Q0= 0, FF1 is in the no-change mode and remains in its present state.
The output of FF2 (Q2) changes state both times; it is preceded by the unique
condition in which both Q0 and Q1 are HIGH. This condition is detected by the AND
gate and applied to the J2 and K2 inputs of FF3. Whenever both outputs Q0= Q1= 1,
Prepared By S.KAVIARASAN /Asst. Prof., PIT
68
2020-21 CS8351 Digital Principles and System Design Unit III
the output of the AND gate makes the J2= K2= 1 and FF2 toggles on the following clock
pulse. Otherwise, the J2 and K2 inputs of FF2 are held LOW by the AND gate output,
FF2 does not change state.
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 (recycles) 0 0 0
Timing diagram
69
2020-21 CS8351 Digital Principles and System Design Unit III
Therefore, when Q0= Q1= Q2= 1, Flip-Flop FF3 toggles and for all other times it
is in a no-change condition. Points where the AND gate outputs are HIGH are
indicated by the shaded areas.
Timing diagram
3.14.4 4-Bit Synchronous Decade Counter: (BCD Counter):
BCD decade counter has a sequence from 0000 to 1001 (9). After 1001 state it
must recycle back to 0000 state. This counter requires four Flip-Flops and AND/OR
logic as shown below.
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
10(recycles) 0 0 0 0
70
2020-21 CS8351 Digital Principles and System Design Unit III
• 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:
• Finally, FF3 (Q3) changes to the opposite state on the next clock pulse each time
Q0 = 1, Q1 = 1, and Q2 = 1 (state 7), or when Q0 = 1 and Q1 = 1 (state 9). The
equation for this is as follows:
Timing diagram
71
2020-21 CS8351 Digital Principles and System Design Unit III
3.14.5 Synchronous UP/DOWN Counter
An up/down counter is a bidirectional counter, capable of progressing in either
direction through a certain sequence. A 3-bit binary counter that advances upward
through its sequence (0, 1, 2, 3, 4, 5, 6, 7) and then can be reversed so that it
goes through the sequence in the opposite direction (7, 6, 5, 4, 3, 2, 1,0) is an illustration
of up/down sequential operation.
The complete up/down sequence for a 3-bit binary counter is shown in table
below. The arrows indicate the state-to-state movement of the counter for both its UP
and its DOWN modes of operation. An examination of Q0 for both the up and down
sequences shows that FF0 toggles on each clock pulse. Thus, the J0 and K0 inputs of FF0
are,
J0= K0= 1
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.
72
2020-21 CS8351 Digital Principles and System Design Unit III
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
73
2020-21 CS8351 Digital Principles and System Design Unit III
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.
For example, MOD-10 counter reaches state 10 (1010). i.e., Q3Q2Q1Q0= 1 0 1 0. The
outputs Q3 and Q1 are connected to the NAND gate and the output of the NAND gate
goes LOW and resetting all Flip-Flops to zero. Therefore MOD-10 counter counts from
0000 to 1001. And then recycles to the zero value.
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—
i. Serial in- serial out,
ii. Serial in- parallel out,
iii. Parallel in- serial out,
iv. Parallel in- parallel out.
(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.
75
2020-21 CS8351 Digital Principles and System Design Unit III
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.
To get the data out of the register, the bits must be shifted out serially and taken
76
2020-21 CS8351 Digital Principles and System Design Unit III
off the Q3 output. After CLK4, the right-most bit, 0, appears on the Q3 output.
When clock pulse CLK5 is applied, the second bit appears on the Q3 output.
Clock pulse CLK6 shifts the third bit to the output, and CLK7 shifts the fourth bit to
the output. While the original four bits are being shifted out, more bits can be shifted
in. All zeros are shown being shifted out, more bits can be shifted in.
Four bits (1010) being entered serially-shifted out of the register and replaced by all zeros
77
2020-21 CS8351 Digital Principles and System Design Unit III
78
2020-21 CS8351 Digital Principles and System Design Unit III
3.15.3 Parallel-In Serial-Out Shift Register:
In this type, the bits are entered in parallel i.e., simultaneously into their
respective stages on parallel lines.
A 4-bit parallel-in serial-out shift register is illustrated below. There are four
data input lines, X0, X1, X2 and X3 for entering data in parallel into the register. SHIFT/
LOAD input is the control input, which allows four bits of data to load in parallel into
the register.
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.
3.15.4 Parallel-In Parallel-Out Shift Register:
In this type, there is simultaneous entry of all data bits and the bits appear on
parallel outputs simultaneously.
79
2020-21 CS8351 Digital Principles and System Design Unit III
The input 0 in each MUX is selected when S1S0= 00 and input 1 is selected when
80
2020-21 CS8351 Digital Principles and System Design Unit III
S1S0= 01. Similarly inputs 2 and 3 are selected when S1S0= 10 and S1S0= 11 respectively.
The inputs S1 and S0 control the mode of the operation of the register.
4-Bit Universal Shift Register
When S1S0= 00, the present value of the register is applied to the D-inputs of the
Flip-Flops. This is done by connecting the output of each Flip-Flop to the 0 input of
the respective multiplexer. The next clock pulse transfers into each Flip-Flop, the
binary value is held previously, and hence no change of state occurs.
When S1S0= 01, terminal 1 of the multiplexer inputs has a path to the D inputs of
the Flip-Flops. This causes a shift-right operation with the lefter serial input
transferred into Flip-Flop FF3.
When S1S0= 10, a shift-left operation results with the right serial input going into
Flip-Flop FF1.
Finally when S1S0= 11, the binary information on the parallel input lines (I1, I2,
I3 and I4) are transferred into the register simultaneously during the next clock pulse.
The function table of bi-directional shift register with parallel inputs and parallel
outputs is shown below.
Mode Control
Operation
S1 S0
81
2020-21 CS8351 Digital Principles and System Design Unit III
0 0 No change
0 1 Shift-right
1 0 Shift-left
1 1 Parallel load
82
2020-21 CS8351 Digital Principles and System Design Unit III
83