Chapter 2 Sequential Logic-V1 - 1
Chapter 2 Sequential Logic-V1 - 1
Chapter II
Sequential Logic Circuits
Presented by
✓ Differentiate between synchronous and asynchronous circuit : latch and flip-flops circuits RS, T, D and JK
✓ Analyze sequential logic circuits- Using state table, state equations and state diagrams
✓ Design sequential synchronous logic circuits- Using Flipflops and logic gates
1. Introduction
2. Latch and flipflops
3. synchronous flipflops (RS, D, JK, T)
4. Registers
5. Sequential circuits analysis
6. Synchronous circuit synthesis
a) Moore and Mealy machines
b) State table and state diagram
7. Synchronous circuit design
a) examples
b) State reduction
8. Counters
a) synchronous counters
b) Ripple counters
9. Data storage and memories
• The outputs of a sequential circuit depend upon the present state of the inputs and the
values of stored bits in the memory unit.
Asynchronous sequential logic, in contrast, doesn't rely on a global clock signal. The circuit
responds to changes in inputs or events as they occur, without being tied to a specific clock
cycle.
Advantages: Asynchronous circuits can potentially be more responsive and have a simpler
structure, as they don't need a global clock. However, they can be more challenging to
design and analyze due to the lack of a centralized timing mechanism.
Detected
Rising Edge
Example:
The circuit of the following figure is called a latch.
• For this circuit, if we suppose initially that 𝐿𝑎𝑡𝑐ℎ 𝐶𝑜𝑚𝑚𝑎𝑛𝑑 = 0 𝑎𝑛𝑑 𝑄 = 0 the output
remains at Low level (0)
• When the latch input is forced HI (𝐿𝑎𝑡𝑐ℎ 𝐶𝑜𝑚𝑚𝑎𝑛𝑑 = 1), the output Q will go HI ⇒ 𝑄 = 1.
The feedback loop from the output to the input will cause the output Q to remain at HI
logic level even if the input goes LOW (𝐿𝑎𝑡𝑐ℎ 𝐶𝑜𝑚𝑚𝑎𝑛𝑑 = 0)
• Thus this latch is now latched (state memorized) and the command has no further effect
Note:
The table used to describe the inputs RS
combinations and their resultant outputs is
referred to as a characteristic table, it is
similar to a truth table.
Copyright © Karim Ben Si Said L1 – MI -2024/2025 14
Chapter- 3: Latch and Flip-Flop
➢ In this case, the S (Set) input is activated with the LOW state (0) and
forces the output Q to HI state: 𝑄 = 1 RS
FF
➢ When the input R (Reset or Clear) is LO, the output goes LO: 𝑄 = 0
➢ When both inputs are HI, the output of the flip-flop keeps it previous state.
➢ Setting both inputs to LO is forbidden
The output Q’ is the complement of the output Q
→ Synchronous Flip-Flop
• The following symbols are used to designate the triggering type on the clock input
set set
D Q J Q T Q S Q J Q S Q
ഥ ഥ
Q ഥ K ഥ
Q R ഥ
Q
Q K ഥ
Q R Q clr clr
20
Chapter- 3: Latch and Flip-Flop
→ Characteristic table
• In sequential logic, a Characteristic table is a tabular representation that outlines the relationship between
the present state, inputs, and the next state of the memory elements, such as flip-flops or latches.
• This table enumerates all possible combinations of inputs and current states, detailing the resulting state
changes. It provides a systematic way to analyze and understand the behavior of sequential circuits by
mapping out how they respond to different input conditions.
• In a characteristic table, the clock condition (rising edge, falling edge, or clock level) is assumed to be
established. We solely consider the inputs and present states to determine the future states.
Example: draw the Characteristic table, then write the characteristic equation for the of the D flip-flop
S R Q N Q N+1
0 0 0 0
0 0 1 1 S
0 1 0 0
R
0 1 1 0
1 0 0 1
1 0 1 1
1 1 0 X
1 1 1 X Copyright © Karim Ben Si Said L1 – MI -2024/2025 23
Chapter- 3: Latch and Flip-Flop
S R Q N Q N+1 0 0 0 0
0 0 0 0 0 0 1 1
0 0 1 1 0 1 0 0
0 1 0 0 0 1 1 0
0 1 1 0 1 0 0 1
1 0 0 1 1 0 1 1
1 0 1 1 1 1 0 1
1 1 0 X 1 1 1 0
1 1 1 X 29
Copyright © Karim Ben Si Said L1 – MI -2024/2025
Chapter- 3: Latch and Flip-Flop
Moore machines are often preferred for simpler designs with less complex output behavior, while Mealy
machines are more flexible and can handle situations where output behavior depends on both state and input
conditions. In the remaining of this course, we will use Mealy machine.
Moore
Copyright © Karim Ben Si Said Machine
L1 – MI -2024/2025 Mealy Machine 34
Chapter- 3: Sequential circuit design and analysis
• Step1:
write the FF-input equation: The equations at the
inputs DA and DB in function of An, Bn, and X.
𝐷𝐴 = 𝐴𝑛. 𝑋 + 𝐵𝑛. 𝑋
𝐷𝐵 = 𝐴𝑛 . 𝑋
An An+1
Copyright © Karim Ben Si Said L1 – MI -2024/2025 36
Chapter- 3: Sequential circuit design and analysis
→ circuit analysis– example
• Step3: Elaborate the state Table: Method-1
Fill up (using the state equations) the table containing the inputs (X), the present states of the FF
(An and Bn), and the future states of the FF (An+1 and Bn+1) in addition to the circuit output (Y).
inputs Outputs
The table containing :
- as inputs (the input X, and the present state of the FF: An, Bn)
- As outputs: - The future states of the FF (An+1 and Bn+1)
- The circuit’s other outputs (Y)
An Bn X An+1 Bn+1 Y
Notes: - The values in columns AN+1, BN+1 and Y of the table are
computed using state equations found in step-2
𝐴𝑛 + 1 = 𝐴𝑛. 𝑋 + 𝐵𝑛. 𝑋
𝐵𝑁 + 1 = 𝐴𝑛 . 𝑋
𝑌 = 𝑋ഥ (𝐴𝑛 + 𝐵𝑛)
Present FF Next
Thus, two characteristic tables for the D flip-flops are formed: input output
state Inputs state
➢ DA flip-flop values are highlighted in blue. AN BN X DA DB AN+1 BN+1 Y
➢ DB flip-flop values are highlighted in purple. 0 0 0 0 0 0 0 0
0 0 1 0 1 0 1 0
0 1 0 0 0 0 0 1
Notes: - The characteristic table of D-FF: 0 1 1 1 1 1 1 0
An DA An+1 1 0 0 0 0 0 0 1
0 0 0 1 0 1 1 0 1 0 0
0 1 1 1 1 0 0 0 0 0 1
1 0 0 1 1 1 1 0 1 0 0
1 1 1 38
Copyright © Karim Ben Si Said L1 – MI -2024/2025
Chapter- 3: Sequential circuit design and analysis
→ circuit analysis– example
• Step3: Elaborate the state Table:
Another common approach is to group present and future states based on the input value (x = 0
and x = 1). Both forms of state tables are valid and can be used.
• For the Maely representation, the value of states are written inside Example: state Diagram for a
the circles and above the arrows representing the transitions, we transition from 01 to 11 with
write the Inputs / outputs combinations. input x=1 and output y =0
• The number of states depends often on the number of flip-flops
AB
Thus, From the state table the state diagram is given bellow:
d. State diagram
a. Circuit diagram Copyright © Karim Ben Si Said L1 – MI -2024/2025 44
Chapter- 3: Sequential circuit design and analysis
0
1
1
0
1
0
0
1
1
1
1
0
0
1
0
1
1 0 1 1 1 0 1 1
1 1 0 1 1 0 1 1
1 1 1 1 1 1 1 0
c. State table format 1
Copyright © Karim Ben Si Said L1 – MI -2024/2025 47
Chapter- 3: Sequential circuit design and analysis c. State table
→ circuit analysis– example 4
From the state table, the state diagram is drawn.
d. State diagram
• There are two stable states: 00 and 01 when the input x=0.
Reminder:
Mealy Machine
AN AN+1 DA 0 1 1 1 0 0 1 0
1 0 0 0 0 1 0 0
0 0 0
1 0 1 1 1 0 1 1
excitation table
0 1 1 1 1 0 0 0 1 0 0
Of D-Flipflop
1 0 0 1 1 1 1 1 1 1 1
1 1 1
54
Copyright © Karim Ben Si Said L1 – MI -2024/2025
Chapter- 3: Sequential circuit design
→ Excitation table-Definition
• In sequential logic, an excitation or transition table is a table that lists the present state, the desired next
state as inputs and the flip-flop inputs (J, K, D, etc.) required to achieve that as outputs.
• The goal here is to find the flip-flop inputs that led to this output transition from state QN to QN+1
• When the required input can be ‘1’ or ‘0’, we put an ‘X’ for the input
QN QN+1 J K QN QN+1 J K
0 0 0 0 or 1 => X 0 0 0 X
0 1 1 0 or 1 => X 0 1 1 X
1 0 0 or 1 => X 1 1 0 X 1
1 1 0 or 1 => X 0 1 1 X 0
S Q D Q
ഥ ഥ
Q
R Q
Bx Bx 00 01 11 10 Bx 00 01 11 10
A 00 01 11 10 A A
0 0 0 1 0 0 0 1 0 0 0 0 0 0 1
1 0 1 1 0 1 0 1 1 0 1 1 0 1 1
57
Copyright © Karim Ben Si Said L1 – MI -2024/2025
Chapter- 3: Sequential circuit design
→ Sequential circuit design–Example1
4. Draw the circuit (design with D-FF)
Draw the logic sequential circuit using the FF-inputs equations DA and D𝐁 and the output equation Y
DA = X (Bn + An)
DB = X (Bn + An)
Y=ഥ
X An + Bn + An. Bn
Present Next
input output Excitation table
state state
AN BN X AN+1 BN+1 Y JA KA JB KB
excitation table 0 0 0 0 0 0 0 X 0 X
Of JK-Flipflop 0 0 1 0 1 0 0 X 1 X
0 1 0 0 0 1 0 X X 1
QN QN+1 J K 0 1 1 1 0 0 1 X X 1
0 0 0 X 1 0 0 0 0 1 X 1 0 X
1 0 1 1 1 0 X 0 1 X
0 1 1 X
1 1 0 0 0 1 X 1 X 1
1 0 X 1 1 1 1 1 1 1 X 0 X 0
1 1 X 0
59
Copyright © Karim Ben Si Said L1 – MI -2024/2025
Chapter- 3: Sequential circuit design
→ Sequential circuit design–Example1
3. FF-inputs equations table(design with JK-FF)
JA = B. x JB = X
Bx
Bx 00 01 11 10 A 00 01 11 10
A
0 0 0 1 0 0 0 1 X X Bx 00 01 11 10
A
1 X X X X 1 0 1 X X 0 0 0 0 1
1 1 0 1 1
KA = xത KB = ഥ ഥ
X+A
A
Bx 00 01 11 10 A
Bx 00 01 11 10 Y = An. ഥ
X + An. Bn + Bn. ഥ
X
0 X X X X 0 X X 1 1 Y=ഥ X An + Bn + An. Bn
1 1 0 0 1 1 X X 0 1
60
Copyright © Karim Ben Si Said L1 – MI -2024/2025
Chapter- 3: Sequential circuit design
→ Sequential circuit design–Example1
4. Draw the circuit (design with JK-FF)
Draw the logic sequential circuit using the FF-inputs equations JA,KA, JB and KB and the output
equation Y
JA = B. x
KA = xത
JB = X
KB = ഥ ഥ
X+A
Y=ഥ
X An + Bn + An. Bn
61
Copyright © Karim Ben Si Said L1 – MI -2024/2025
Chapter- 3: Sequential circuit design
→ Sequential circuit design–Example2
Design the sequential circuit defined by the following state diagram using D-FF, then JK-FF.
1. State table:
• This sequential circuit contains 4 bubbles (each bubble represents a state), 1 input and 1 output.
State
• With 4 states, such circuit needs 2 Flip-Flops (A and B)
diagram
• We assign to each state a FF output combination (Assign binary values to the states ): With
S0 = 0 0, S1 = 0 1, S2 = 1 0, and S3 = 1 1 assigned
states
Given
Reminder: state
Moore Machine diagram
>
• 𝐷𝐴 = 𝐴𝑁 𝑥 + 𝐵𝑁 𝑥
• 𝐷𝐵 = 𝐴𝑁 𝑥 + 𝐵𝑁 𝑥
• 𝑦 = 𝐴. 𝐵
KA = xത
Bx y = A. B
A 00 01 11 10
Bx
0 X X X X A 00 01 11 10
1 1 0 0 1 0 0 0 0 0 JA = B. x
1 0 0 1 1
KA = xത
JB = x
Bx 00 01 11 10 JB = x
A
0 0 1 X X ഥB
KB = xത + A
1 0 1 X X
y = A. B 68
Copyright © Karim Ben Si Said L1 – MI -2024/2025
Chapter- 3: Sequential circuit design
→ Sequential circuit design–
Exercise
Synthesize the circuit defined by the following state diagram using T-FF and JK-FF
• This circuit utilizes outputs generated by three flip-flops (FF), without any involvement
of combinational inputs or outputs.
1. Draw its transition table
2. Design its circuit using T flip-flops
3. Design the circuit using JK-FF.
4. What is the function realized by this circuit ?
69
Copyright © Karim Ben Si Said L1 – MI -2024/2025
Chapter- 3: Sequential circuit design
• This circuit has one input X and one output y and 14 transitions between 7 states.
Two states are said to be equivalent if : for the same input combination, the
transition from the present states to next states is equivalent and yields identical
outputs.
• From the state table, for instance, states e and g are found to be equivalent as they lead to the
same next states and have identical outputs for both input combinations.
• Thus, the row with present state g is removed, and g state is replaced by state e each time it occurs
in the columns headed “Next State.”
Present Next state Output y
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 e f 0 1
g a f 0 1
Copyright © Karim Ben Si Said L1 – MI -2024/2025 71
Chapter- 3: Sequential circuit design
• Thus, following the same procedure as previous, the row with present state f is removed, and f
state is replaced by e state each time it occurs in the columns headed “Next State.”
Exercise:
design the circuit of this reduced
state diagram using JK and D-FF
using One-hot states assignment
Copyright © Karim Ben Si Said L1 – MI -2024/2025 73