State Machine Design
Sequence Detector
Step1\ State Diagram: Derive the state diagram by
representing each state as a character
Step 2\ State Table:
a) Derive state table for the circuit
b) Minimize the state table.
Step 3\ State Assignment: Count the number of states in the
state diagram (call it N) and calculate the number of flip-flops needed
(call it P) by solving the equation 2P-1 < N 2P . This is best solved by
guessing the value of P.
Step 4\ Transition table:
a) Derive another state table that assign a unique P-bit binary
number (state vector) to each state
b) Arrange the last table and add the excitation table columns of
the JK Flip Flop (or any other Flip Flop that you want to use )
Step 5\ Equations: Draw K-Map and find the equation for each J
and K of each flip flop in the excitation table.
Step 6\ Logic Circuit: Design the logic diagram.
1
Example: Design 101 Sequence Detector
Or: Design a digital system which receives serial
transmission data (x) and produce output (z). The
output will be Z=1 when the sequence 101 is received.
Solution:
Step1\ State Diagram 0/0
1/0 1/0
0/0
1/0 0/0 1/1
a b c d
0/0
Step2\ State Table
a) State Table
Present State Next State / Output
X=0 X=1
a a/0 b/0
b c/0 b/0
c a/0 d /1
d a/0 b/0
2
b) State Minimization
We can notice that a and d have the same next state and
output so we will keep just one, we will keep a and any
other d in the table will be changed to the first state a
Present State Next State / Output
X=0 X=1
a a/0 b/0
b c/0 b/0
c a/0 a /1
Step 3\ State Assignment
2P-1 < 3 2P
So P = 2 so we need 2 JK Flip Flops
Step 4\ Transition table:
a) Let a=00 , b=01 , c=10 , so:
Present State Next State / Output
X=0 X=1
00 00 / 0 01 / 0
01 10 / 0 01 / 0
10 00 / 0 00 / 1
b) After arranging and using JK FF:
QA QB X QA+ QB+ JA KA JB KB Z
0 0 0 0 0 0 d 0 d 0
0 0 1 0 1 0 d 1 d 0
0 1 0 1 0 1 d d 1 0
0 1 1 0 1 0 d d 0 0
1 0 0 0 0 d 1 0 d 0
1 0 1 0 0 d 1 0 d 1
According to the table, Z will be 1 When QA=1 , QB=0 , X=1
So, Z = QA QB X
3
Step 5\ Boolean Equations:
K-Map Simpilfication:
0 1 d d d d d 1
0 0 d d d d d 1
JA = QB 𝑿 KA = 1
0 d d 0 d 1 d d
1 d d 0 d 0 d d
JB = 𝑸A X KB = 𝑿
Step 6\ Logic Circuit:
We knew that Z = X QB QA
X
Z
CLK