Class Notes CH03 Part 2
Class Notes CH03 Part 2
3
Boolean Algebra
and Digital Logic
Part 2—Sequential
Circuits
Enable
b
0
3-bit Binary Counter
b
1
b
2
Clock
Sequential Circuits--
Example
• State diagram
Enable
3-bit Binary Counter b
0
b
1
b
Clock 2
Combinational Circuits
x
1 z
1
x
... ...
2
Combinational
x Circuit
n Z
m
• z = f (x , x , …,x )
i i 1 2 n
03/03/2025 A. Berrached 8
Sequential Circuits
X
...
1 Z
X 1
...
2
Combinational Z
X m
n Circuit
...
1
Clock
• z = f (x , x , …,x y
i i 1 2
y)
n, 1, …, r
03/03/2025 A. Berrached 9
3.7 Sequential Circuits
• Combinational circuits don’t remember anything about
past inputs. Output depends only on the current input
• Sequential circuits: Output is a function of the input
and the present state of the circuit i.e. y1…yr
...
1 Z
X 1
...
2
Combinational Z
X m
n Circuit
...
1
Clock
• z = f (x , x , …,x y
i i 1 2
y)
n, 1, …, r
03/03/2025 A. Berrached 14
Sequential Circuits
Operations Q(t+1)
Q
Set state to 1 (store 1) 1
Set state to 0 (store 0) 0
Hold state (latch) Q(t)
SR Latch 0 0 Q(t)
S Q
0 1 0
1 0 1
1 1 X
• S = 1 store 1
• R = 1 store 0
• S & R both 0 hold (also called latch)
• Does what it’s supposed to do in Slide #2
• S & R both 1 Q(t+1) is unpredictable
• Also, when is t+1?
03/03/2025 Ali Berrached--CS2425 19
JK Flip Flop
C J K Q+
↑ 0 0 Q
0
↑ 0 1 1
Q’
↑ 1 0
↑ 1 1
Flip Flop
↑ 0 0 Q
0
↑ 0 1 1
Q
Q’
K
↑ 1 0
↑Characteristic
1 1 Table
C J K Q Q+
Characteristic Equation: ↑ 0 0 0 0
↑ 0 0 1 1
Q+ = J.Q’ + K’.Q ↑ 0 1 0 0
00, 01
10, 11
↑ 0 1 1 0
00, 10 ↑ 1 0 0 1
0 1 ↑ 1 0 1
↑ 1 1 0 1
↑ 1 1 1 1
11, 01 0
Finite State Machine (FSM)
03/03/2025 Ali Berrached--CS2425 21
State Diagram
Timing Diagram
C
Q
D
Q
J
D J-K
D Flip Flop
C Flip Flop
C
Q
K Q
D Q(t+1)
Characteristic Equation:
0 0
1 1 Q(t+1) = D
In
0
Out
0
Out
1
Out
2
Out
3
Count
Enable
b
0
b
1
b
2
b
3
Output
b
0
b
1
b
2
b
3
Sequential Circuits—
Counters_Exercise
Draw the state diagram of the 4-bit counter.
X
1
.. 1
2
.. . Z
.
Combinational m
X
n Circuit
..
1
. Flip Flops ..
Y
r .
Clock
03/03/2025 A. Berrached 34
Analysis of Sequential
Circuits
• Zi = fi(X1, X2, …,Xn, Y1, Y2, …,Yr, )
03/03/2025 A. Berrached 35
Analysis of Sequential
Circuits
1. Identify the inputs, the outputs, and the state
variables. Are outputs synchronous?
2. Derive an expression for each output
3. Derive the F/Fs input equations
4. Derive the next state equations
5. Derive the CKT's State Transition
6. FSM if needed
7. Timing diagrams if needed
03/03/2025 A. Berrached 36
State Transition Table
PresentState Input NextState Output
03/03/2025 A. Berrached 37
Finite State Machine
• The behavior of sequential circuits can be expressed
using state transition tables or finite state machines
(FSMs).
• FSMs consist of a set of nodes that hold the states of the
machine and a set of arcs that connect the states.
• FSM is a graphical depiction of State Transition Table
0/0 1/0
0/0
A B
1/1
1/0
0/1 C
1 1/1
1 1 1/0
D/1 0 C/0 C
0/1
B
D Q
C
03/03/2025 A. Berrached 42
Example1 Cont.
Step1: Input is X output is Z state variables: A & B
Step 2: Output equations: Z = AX' + BX’ (Mealy or Moore?)
Step 3: FF input equations:
DA = AX + BX
DB = A'X
Step 4: D flip flop characteristic eq: Q+= D
A+ = DA A+ = AX + BX
B+ = DB B+ = A'X
03/03/2025 A. Berrached 43
Example 1 Cont.
Step 4: State Transition Table
03/03/2025 A. Berrached 44
Analysis of Sequential
Circuits--Exercise
Draw FSM
Note: Is this a Mealy or Moore machine?
03/03/2025 A. Berrached 45
Analysis of Sequential
Circuits--Exercise
Assume Input Sequence: 00101110
What’s the output?
03/03/2025 A. Berrached 46
Analysis of
Sequential
Circuits
Example 2
Example 2
A
J Q
Z
X
K Q
B
J Q
K Q
03/03/2025 A. Berrached 48
Example2: Analysis
Step 1: Inputs: X outputs: Z State Variables: A & B
Step 2: output equations: Z = AB’ Mealy or Moore?
Step 3: Flip Flop Input Equations:
JA = B KA = BX'
JB = X’ KB = AX' + A’X
Step 4: Use J-K Flip Flop characteristic table to get circuit
state table
J K Q+
0 0 Q
0 1 0
1 0 1
1 1 Q’
03/03/2025 A. Berrached 49
State Transition Table
03/03/2025 A. Berrached 50
Analysis of Sequential
Circuits--Exercise
Draw FSM
Note: Is it Mealy or Moore?
03/03/2025 A. Berrached 51
Analysis of Sequential
Circuits-Exercise
Input sequence: 010110
03/03/2025 A. Berrached 52
Analysis of Sequential
Circuits-Exercise
Draw state transition table of the following circuit
Flip Flop
Positive edge-
triggered
J = X’A K = X’A+A’
X A J K A+
0 0 0 1 0
0 1 1 1 0
1 0 0 1 0
1 1 0 0 1
Analysis of Sequential
Circuits-Exercise
• Suppose the state machine shown below is in State
A and receives the string 1001001. What is its
output?
Analysis of Sequential
Circuits-Exercise
Time 1 2 3 4 5 6 7 8
Input 1 0 0 1 0 0 1
State A D C D A B B C
Output 00 10 11 10 00 0 01 11
Conclusion
Sequential Circuits
Conclusion
• The output of a sequential circuits depends on the input and
the state of the circuit.
• Sequential circuits require clocks to control their changes of
state.
• The state of a sequential circuit is stored using flip flops
• The basic sequential circuit unit is the flip-flop: The behaviors
of the SR, JK, and D flip-flops are the most important to know.
• The behavior of sequential circuits can be expressed using
state transition tables or finite state machines (State
Diagrams) .
• Common examples of sequential circuits include memory,
counters, sequence detectors etc.