Академический Документы
Профессиональный Документы
Культура Документы
Logistics
Last lecture
Today
Moore/Mealy machines
Midterm 2 topics and logistics
CSE370, Lecture 19
CSE370, Lecture 19
outputs
Inputs
output
logic
Next-state
logic
Outputs
Next State
Current State
CSE370, Lecture 19
combinational
logic for
next state
Moore machine
Outputs are a function
of current state
reg
logic for
outputs
state feedback
inputs
logic for
outputs
combinational
logic for
next state
state feedback
CSE370, Lecture 19
outputs
reg
outputs
Outputs change
synchronously with
state changes
Mealy machine
Outputs depend on state
and on inputs
Input changes can cause
immediate output changes
(asynchronous)
4
Counter-design procedure
1.
2.
3.
4.
State diagram
State-transition table
Next-state logic minimization
Implement the design
FSM-design procedure
1.
2.
3.
4.
5.
6.
State diagram
State-transition table
State minimization
State encoding
Next-state logic minimization
Implement the design
CSE370, Lecture 19
State Diagrams
Moore machine
Each state is labeled by a pair:
state-name/output
or
state-name
[output]
Mealy machine
Each transition arc is labeled by a pair:
input-condition/output
CSE370, Lecture 19
DQ
Q
DQ
Q
DQ
Q
DQ
Q
clock
Moore
out
A
D Q
Q
D Q
Q
clock
CSE370, Lecture 19
Mealy
7
0
1
B/0
0
reset
D/1
A/0
1
1
C/0
1
CSE370, Lecture 19
E/1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
1
0
1
0
1
A
A
B
B
C
C
D
D
E
E
A
B
C
B
D
E
C
E
C
B
D
current
output
0
0
0
0
0
0
0
1
1
1
1
8
0/0
B
0/0
reset/0
0/1
1/1
1/0
C
current next
reset input state
state
1
0
0
0
0
0
0
0
1
0
1
0
1
A
A
B
B
C
C
A
B
C
B
C
B
C
current
output
0
0
0
0
1
1
0
1/0
CSE370, Lecture 19
Moore machines
+ Safer to use because outputs change at clock edge
May take additional logic to decode state into outputs
Mealy machines
+ Typically have fewer states
+ React faster to inputs don't wait for clock
Asynchronous outputs can be dangerous
We often design synchronous Mealy machines
Design a Mealy machine
Then register the outputs
CSE370, Lecture 19
10
inputs
logic for
outputs
combinational
logic for
next state
reg
outputs
reg
state feedback
CSE370, Lecture 19
11
A
B
Registered
Mealy
(actually
Moore)
D
clock
out
out
Q
Q
B
clock
CSE370, Lecture 19
Q
Q
Moore
12
CSE370, Lecture 19
13
Moore
Mealy
0
0/00
Even
[0]
1
Even
[0]
1
11/0
1/11
Odd
[1]
Odd
[1]
0/1
CSE370, Lecture 19
14
Input
Even
Even
Odd
Odd
0
1
0
1
Next
State
Even
Odd
Odd
Even
Present
Output
0
0
1
1 Present
State
Even
Even
Odd
Odd
CSE370, Lecture 19
Mealy
Input
0
1
0
1
Next
State
Even
Odd
Odd
Even
Present
Output
0
1
1
0
15
CSE370, Lecture 19
16
4. State encoding
Moore
Present
State
0
0
1
1
Input
Next
State
Present
Output
0
1
0
1
0
1
1
0
0
0
1
1
Mealy
Present
State
0
0
1
1
CSE370, Lecture 19
Input
Next
State
Present
Output
0
1
0
1
0
1
1
0
0
1
1
0
17
Assume D flip-flops
Next state = (present state) XOR (present
input)
Mealy
Output
Moore
Input
Output
Input
CLK
CSE370, Lecture 19
Q
Q
Current
State
CLK
18
CSE370, Lecture 19
1010
+ 0110
------------????
19
CSE370, Lecture 19
20
1, 2, 3, 4,
Self-starting counters
CSE370, Lecture 19
21
State diagram
State-transition table
State minimization
State encoding
Next-state logic minimization
Implement the design
No Mealy machines
Don t expect to know a ton of FSM.
Just understand what was presented in the lectures.
CSE370, Lecture 19
22
Midterm 2 logistics
45 minutes long (starts 10:35)
Materials covered from
Lectures 9 to 18 (but not Sequential Verilog or
Moore/Mealy)
HW 4, 5, and 6
Closed book/notes, no calculator
Scratch papers provided
Just have your pencil/pen and eraser
Raise hand for questions (dont walk to get
help)
CSE370, Lecture 19
23