Beruflich Dokumente
Kultur Dokumente
STATE MEMORY
SET
D Q
OUTPUTS
NEXT CLR Q
NEXT STATE STATE OUTPUT LOGIC
...
INPUTS LOGIC
SET
D Q
CLR Q
CLK
• State memory: Set of n flip-flops that hold the state of the machine (up to 2^n
distinct states)
• Next state logic: Combinational circuit that determines the next state as a function
of the current state and the input
• Output logic: Combinational circuit that determines the output as a function of the
current state and the input
Finite State Machine - Types
PREVIOUS STATE
...
INPUTS LOGIC
input D
SET
CLR
Q
CLK
...
INPUTS LOGIC
SET
D Q
CLR Q
CLK
State diagram
A state diagram represents the states as circles and the transitions between them as arrows annotated
with inputs and outputs
1/0
0/0
0/1
00 10
0/1
1/0 0/1 1/0
1/0
01 11
Sequential Circuit Design using FSM
• Understand specifications
• Draw state graph (to describe state machine behavior)
• Construct state table (from state graph)
• Perform state minimization (if necessary)
• Encode states (i.e., state assignment)
• Create state-assigned table
• Select type of Flip-Flop to use
• Determine Flip-Flop input equations and FSM output equation(s)
• Draw logic diagram
5
Example: A sequence detector (Mealy)
To illustrate the design of a clocked Mealy sequential circuit, we will design
a sequence detector.
The circuit is of the form:
6
Example: A sequence detector (Mealy)
X= 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 0
Z= 0 0 0 0 0 1 0 0 0 0 0 1 0 1 0 0
(time: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)
7
Example: A sequence detector (Mealy)
Initially, we do not know how many flip-flops will be required, so we will
designate the circuit states as S0, S1, etc.
If a 0 input is received, the circuit can stay in S0 because the input sequence we
are looking for does not start with a 0.
8
Example: A sequence detector (Mealy)
9
Example: A sequence detector (Mealy)
We can then convert our state graph to a state table:
10
Example: A sequence detector (Mealy)
And then convert our state table to a transition table:
11
Example: A sequence detector (Mealy)
Using the derived equations, we can then draw the corresponding circuit diagram
12
Example: A sequence detector (Moore)
The procedure for finding the state graph for a Moore machine is similar to that used for a Mealy
machine, except that the output is written with the state.
We will rework the previous example as a Moore machine: the circuit should produce an output of 1
only if an input sequence ending in 101 has occurred.