Professional Documents
Culture Documents
16 Lecture PDF
16 Lecture PDF
16 Lecture PDF
ECE Department
Joel D. Schipper
Summer 2007
INPUT
INPUT
STATE
STATE
OUTPUT
OUTPUT
INPUT
Page 1 of 8
University of Florida
ECE Department
Joel D. Schipper
Summer 2007
Example: Design a simple sequence detector for the sequence 011. Include three outputs
that indicate how many bits have been received in the correct sequence.
(For example, each output could be connected to an LED.)
1) Draw a State Diagram (Moore) and then assign binary State Identifiers.
X=1
X=0
X=0
A
000
001
STATES
A=00
B=01
C=11
D=10
X=0
X=1
X=1
X=0
111
011
X=1
Q1
0
0
0
0
1
1
1
1
State
A
A
B
B
D
D
C
C
X
0
1
0
1
0
1
0
1
O2
0
0
0
0
1
1
0
0
O1
0
0
0
0
1
1
1
1
O0
0
0
1
1
1
1
1
1
State+
B
A
B
C
B
A
B
D
Q0
0
0
1
1
0
0
1
1
X
0
1
0
1
0
1
0
1
O2
0
0
0
0
1
1
0
0
O1
0
0
0
0
1
1
1
1
O0
0
0
1
1
1
1
1
1
Q1+
0
0
0
1
0
0
0
1
Page 2 of 8
Q0+
1
0
1
1
1
0
1
0
University of Florida
ECE Department
Joel D. Schipper
Summer 2007
Q0
0
0
1
1
0
0
1
1
X
0
1
0
1
0
1
0
1
O2
0
0
0
0
1
1
0
0
O1
0
0
0
0
1
1
1
1
Q1+
0
0
0
1
0
0
0
1
O0
0
0
1
1
1
1
1
1
Q0+
1
0
1
1
1
0
1
0
D1
0
0
0
1
0
0
0
1
D0
1
0
1
1
1
0
1
0
00
0
0
01
0
1
11
0
1
10
0
0
X\Q1Q0
0
1
00
1
0
01
1
1
11
1
0
10
1
0
D0 = X + Q1Q0
D1 = XQ0
6) Solve equations for Flip-Flop outputs (K-maps)
Q1\Q0
0
1
0
0
1
1
0
0
O2 = Q1Q0
Q1\Q0
0
1
0
0
1
O1 = Q1
1
0
1
Q1\Q0
0
1
O0 = Q1 + Q0
Page 3 of 8
0
0
1
1
1
1
University of Florida
ECE Department
Joel D. Schipper
Summer 2007
Example: Design a sequence detector that searches for a series of binary inputs to satisfy
the pattern 01[0*]1, where [0*] is any number of consecutive zeroes. The
output (Z) should become true every time the sequence is found.
1) Draw a State Diagram (Moore) and then assign binary State Identifiers.
Recall: Picking state identifiers so that only one bit changes from state to state will
generally help reduce the amount of hardware required for implementation.
Only the transition from Success to First requires two bits to change.
2) Make a Next State Truth Table (NSTT)
State
Start
Start
First
First
Success
Success
Second
Second
unused
SuccessD
SuccessD
Delay
Delay
Q2
0
0
0
0
0
0
0
0
1
1
1
1
1
Q1
0
0
0
0
1
1
1
1
0
1
1
1
1
Q0
0
0
1
1
0
0
1
1
*
0
0
1
1
X
0
1
0
1
0
1
0
1
*
0
1
0
1
Z
0
0
0
0
1
1
0
0
X
1
1
0
0
State+
First
Start
First
Second
First
Start
Delay
Success
X
Delay
Success
Delay
SuccessD
Page 4 of 8
Q2+
0
0
0
0
0
0
1
0
X
1
0
1
1
Q1+
0
0
0
1
0
0
1
1
X
1
1
1
1
Q0+
1
0
1
1
1
0
1
0
X
1
0
1
0
University of Florida
ECE Department
Joel D. Schipper
Summer 2007
INPUT/OUTPUT
INPUT/OUTPUT
STATE
STATE
INPUT/OUTPUT
Example: Design a sequence detector that searches for a series of binary inputs to satisfy
the pattern 01[0*]1, where [0*] is any number of consecutive zeroes. The
output (Z) should become true every time the sequence is found.
1) Draw a State Diagram (Mealy) and then assign binary State Identifiers.
Page 5 of 8
University of Florida
ECE Department
Joel D. Schipper
Summer 2007
Initialize
_
0
_
Start
_
1
1
0
0
Start
Start
2
0
0
0
Start
First
3
0
0
0
First
First
4
1
0
0
First
Second
5
0
0
0
Second
Delay
6
0
0
0
Delay
Delay
7
1
0
1
Delay
SuccD
8
0
1
0
SuccD
Delay
9
1
0
1
Delay
SuccD
A
1
1
1
SuccD
Succ
B
1
1
0
Succ
Start
Note: The Moore Machine lags one clock cycle behind the final input in the sequence.
The Mealy Machine can change asynchronously with the input.
Note: The Mealy Machine requires one less state than the Moore Machine! This is
possible because Mealy Machines make use of more information (i.e. inputs) than
Moore Machines when computing the output. Having less states makes for an
easier design because our truth tables, K-maps, and logic equations are generally
less complex. In some cases, the reduction of states is significant because it
reduces the number of flip-flops required for design implementation. In spite of
the advantages of using a design with less states, we will still use the 6-state
Mealy Machine for the remainder of these notes to facilitate a direct
comparison with the 6-state Moore Machine.
Page 6 of 8
C
0
0
0
Start
First
University of Florida
ECE Department
Joel D. Schipper
Summer 2007
Q2
0
0
0
0
0
0
0
0
1
1
1
1
1
Q1
0
0
0
0
1
1
1
1
0
1
1
1
1
Q0
0
0
1
1
0
0
1
1
*
0
0
1
1
X
0
1
0
1
0
1
0
1
*
0
1
0
1
Z
0
0
0
0
0
0
0
1
X
0
1
0
1
State+
First
Start
First
Second
First
Start
Delay
Success
X
Delay
Success
Delay
SuccessD
Q2+
0
0
0
0
0
0
1
0
X
1
0
1
1
Q1+
0
0
0
1
0
0
1
1
X
1
1
1
1
Q0+
1
0
1
1
1
0
1
0
X
1
0
1
0
Q2
0
0
0
0
0
0
0
0
1
1
1
1
1
Q1
0
0
0
0
1
1
1
1
0
1
1
1
1
Q0
0
0
1
1
0
0
1
1
*
0
0
1
1
X
0
1
0
1
0
1
0
1
*
0
1
0
1
Z
0
0
0
0
0
0
0
1
X
0
1
0
1
State+
First
Start
First
Second
First
Start
Delay
Success
X
Delay
Success
Delay
SuccessD
Q2+
0
0
0
0
0
0
1
0
X
1
0
1
1
Q1+
0
0
0
1
0
0
1
1
X
1
1
1
1
Q0+
1
0
1
1
1
0
1
0
X
1
0
1
0
D2
0
0
0
0
0
0
1
0
X
1
0
1
1
D1
0
0
0
1
0
0
1
1
X
1
1
1
1
D0
1
0
1
1
1
0
1
0
X
1
0
1
0
00
0
0
1
X
01
0
0
0
X
11
0
0
1
X
10
0
1
1
X
D2 = Q2 Q0 + Q2 X + Q1Q0 X
Q2Q1\Q0X
00
01
11
10
00
0
0
1
X
01
0
0
1
X
11
1
1
1
X
D1 = Q2 + Q1Q0 + Q0 X
Page 7 of 8
10
0
1
1
X
Q2Q1\Q0X
00
01
11
10
00
1
1
1
X
01
0
0
0
X
11
1
0
0
X
10
1
1
1
X
D0 = Q0 X + Q0 X + Q1Q0
University of Florida
ECE Department
Joel D. Schipper
Summer 2007
0
0
1
1
X
1
0
0
0
X
Q2Q1\Q0X
00
01
11
10
00
0
0
0
X
01
0
0
1
X
11
0
1
1
X
10
0
0
0
X
Z Mealy = Q2 X + Q1Q0 X
Z Moore = Q1Q0
Combo
Logic
D-FF
C
D1
X, Q2, Q1, Q0
Combo
Logic
Q1
D0
Combo
Logic
Z
Combo
Logic
D-FF
C
X, Q2, Q1, Q0
Q2
Q0
D-FF
C
Clk
Notes: The 3 boxes of combinational logic on the left are the same for both of the Moore
and Mealy designs because the state transitions are the same. This would not
have been the case had we implemented the 5-state Mealy Machine.
The larger box of combinational logic on the right is different for the Moore and
Mealy designs because the output, Z, is computed differently.
Page 8 of 8