Logistics
Moore/Mealy machines
Last lecture
Today
Moore/Mealy machines
Midterm 2 topics and logistics
CSE370, Lecture 19
CSE370, Lecture 19
inputs
combinational
logic for
next state
Moore machine
Outputs are a function
of current state
reg
logic for
outputs
outputs
Outputs change
synchronously with
state changes
state feedback
Inputs
output
logic
Next-state
logic
logic for
outputs
inputs
Outputs
combinational
logic for
next state
Next State
Current State
CSE370, Lecture 19
CSE370, Lecture 19
State diagram
State-transition table
Next-state logic minimization
Implement the design
State diagram
State-transition table
State minimization
State encoding
Next-state logic minimization
Implement the design
CSE370, Lecture 19
Moore machine
FSM-design procedure
1.
2.
3.
4.
5.
6.
State Diagrams
Counter-design procedure
1.
2.
3.
4.
reg
state feedback
3
Mealy machine
Outputs depend on state
and on inputs
outputs
or
state-name [output]
Mealy machine
CSE370, Lecture 19
out
A
DQ
Q
DQ
Q
DQ
Q
DQ
Q
out
A
D Q
Q
D Q
Q
clock
Mealy
0/1
1/1
1/0
C
A
B
C
B
D
E
C
E
C
B
D
0
0
0
0
0
0
0
1
1
1
1
8
Moore machines
+ Safer to use because outputs change at clock edge
May take additional logic to decode state into outputs
current next
reset input state
state
1
0
0
0
0
0
0
E/1
A
A
B
B
C
C
D
D
E
E
CSE370, Lecture 19
0/0
reset/0
0
1
0
1
0
1
0
1
0
1
1
1
1
7
0/0
0
A/0
C/0
reset
CSE370, Lecture 19
1
0
0
0
0
0
0
0
0
0
0
D/1
clock
Moore
B/0
current
output
0
1
0
1
0
1
A
A
B
B
C
C
A
B
C
B
C
B
C
0
0
0
0
1
1
0
Mealy machines
+ Typically have fewer states
+ React faster to inputs don't wait for clock
Asynchronous outputs can be dangerous
current
output
1/0
CSE370, Lecture 19
10
CSE370, Lecture 19
No glitches on outputs
No race conditions between communicating machines
Recognize AB = 01
Mealy or Moore?
A
D
inputs
logic for
outputs
combinational
logic for
next state
reg
outputs
Registered Mealy
(actually Moore)
reg
clock
out
out
Q
Q
state feedback
CSE370, Lecture 19
clock
11
CSE370, Lecture 19
Q
Q
Moore
12
State diagram
Moore
Mealy
0/00
Even
[0]
Even
[0]
1 1/0
1/11
Odd
[1]
Odd
[1]
0/1
CSE370, Lecture 19
CSE370, Lecture 19
13
14
1. State-transition table
Moore
Present
State
Input
Next
State
Even
Even
Odd
Odd
0
1
0
1
Even
Odd
Odd
Even
Present
Output
0
0
1
1 Present
State
Even
Even
Odd
Odd
Mealy
Input
Next
State
Present
Output
0
1
0
1
Even
Odd
Odd
Even
0
1
1
0
CSE370, Lecture 19
CSE370, Lecture 19
15
Present
State
Input
Next
State
Present
Output
0
0
1
1
0
1
0
1
0
1
1
0
0
0
1
1
0
0
1
1
Assume D flip-flops
Next state = (present state) XOR (present input)
Input
0
1
0
1
Next
State
0
1
1
0
Mealy
Output
Moore
Mealy
Present
State
16
4. State encoding
CSE370, Lecture 19
Present
Output
Input
Output
Input
0
1
1
0
CLK
17
CSE370, Lecture 19
Q
Q
Current
State
CLK
18
PLAs/PALs
ROMs
Adders
Multi-level logic
Timing diagrams
Hazards
1010
+ 0110
------------????
CSE370, Lecture 19
19
Counters
Timing diagrams
Shift registers
Ring counters
State diagrams and state-transition tables
Counter design procedure
1.
2.
3.
4.
20
CSE370, Lecture 19
1, 2, 3, 4,
State diagram
State-transition table
State minimization
State encoding
Next-state logic minimization
Implement the design
No Mealy machines
Self-starting counters
CSE370, Lecture 19
21
Midterm 2 logistics
CSE370, Lecture 19
23
CSE370, Lecture 19
22