simple finite state machines
TRANSCRIPT
![Page 1: Simple Finite State Machines](https://reader033.vdocuments.us/reader033/viewer/2022050612/6273f8ce1c62a0478171044f/html5/thumbnails/1.jpg)
Simple Finite State Machines
Last updated 8/3/20
![Page 2: Simple Finite State Machines](https://reader033.vdocuments.us/reader033/viewer/2022050612/6273f8ce1c62a0478171044f/html5/thumbnails/2.jpg)
2 © tjEE 3921
Simple FSMs
These slides review the basics of HDL based Finite State Machines
Upon completion: You should be able to design and simulate basic FSMs
![Page 3: Simple Finite State Machines](https://reader033.vdocuments.us/reader033/viewer/2022050612/6273f8ce1c62a0478171044f/html5/thumbnails/3.jpg)
3 © tjEE 3921
Simple FSMs
• Finite State Machine
• Moore Machine
• Outputs depend only on the current state(S)
Next StateLogic
Register(D-FFs)
k kinputs
outputs
SS’M
OutputLogic
N
clk
![Page 4: Simple Finite State Machines](https://reader033.vdocuments.us/reader033/viewer/2022050612/6273f8ce1c62a0478171044f/html5/thumbnails/4.jpg)
4 © tjEE 3921
Simple FSMs
• Finite State Machine
• Mealy Machine
• Outputs depend on the current state(S) and the inputs
Next StateLogic
Register(D-FFs)
kk
inputs
outputs
SS’M
OutputLogic
N
clk
![Page 5: Simple Finite State Machines](https://reader033.vdocuments.us/reader033/viewer/2022050612/6273f8ce1c62a0478171044f/html5/thumbnails/5.jpg)
5 © tjEE 3921
Simple FSMs
• Finite State Machine
• To create an FSM in VHDL you combine• Enumerated types
• Simple register logic
• Combinatorial logic process
• Reset
• An abstraction of the FSM is used for RTL simulation
• Ensure that all states have entry and exit conditions
• Ensure that all states are covered in the code
![Page 6: Simple Finite State Machines](https://reader033.vdocuments.us/reader033/viewer/2022050612/6273f8ce1c62a0478171044f/html5/thumbnails/6.jpg)
6 © tjEE 3921
Simple FSMs
• Sequence detector - CD
• Detecting 11001101
rst
detect = 0resetb
A
detect = 0
1
0
B
detect = 0
1
0
C
detect = 0
0
1
D
detect = 0
0
1
det
detect = 1
G
detect = 0
1 F
detect = 0
0 E
detect = 0
1
10
01 0
![Page 7: Simple Finite State Machines](https://reader033.vdocuments.us/reader033/viewer/2022050612/6273f8ce1c62a0478171044f/html5/thumbnails/7.jpg)
7 © tjEE 3921
Simple FSMs
• Sequence detector - CD
![Page 8: Simple Finite State Machines](https://reader033.vdocuments.us/reader033/viewer/2022050612/6273f8ce1c62a0478171044f/html5/thumbnails/8.jpg)
8 © tjEE 3921
Simple FSMs
• Sequence detector - CD
![Page 9: Simple Finite State Machines](https://reader033.vdocuments.us/reader033/viewer/2022050612/6273f8ce1c62a0478171044f/html5/thumbnails/9.jpg)
9 © tjEE 3921
Simple FSMs
• Sequence detector - CD
![Page 10: Simple Finite State Machines](https://reader033.vdocuments.us/reader033/viewer/2022050612/6273f8ce1c62a0478171044f/html5/thumbnails/10.jpg)
10 © tjEE 3921
Simple FSMs
• Sequence detector - CD
![Page 11: Simple Finite State Machines](https://reader033.vdocuments.us/reader033/viewer/2022050612/6273f8ce1c62a0478171044f/html5/thumbnails/11.jpg)
11 © tjEE 3921
Simple FSMs
• Sequence detector - CD
repeat B Back to start Back to startBack to A
full sequence re-start
![Page 12: Simple Finite State Machines](https://reader033.vdocuments.us/reader033/viewer/2022050612/6273f8ce1c62a0478171044f/html5/thumbnails/12.jpg)
12 © tjEE 3921
Simple FSMs
• Priority Stoplight
ST0
NS: greenEW: red
ST1
NS: yellowEW: red
ST3
NS: redEW: yellow
ST2
NS: redEW: green
reset
TNS
TEW
TNS
TEW
![Page 13: Simple Finite State Machines](https://reader033.vdocuments.us/reader033/viewer/2022050612/6273f8ce1c62a0478171044f/html5/thumbnails/13.jpg)
13 © tjEE 3921
Simple FSMs
• Priority Stoplight
![Page 14: Simple Finite State Machines](https://reader033.vdocuments.us/reader033/viewer/2022050612/6273f8ce1c62a0478171044f/html5/thumbnails/14.jpg)
14 © tjEE 3921
Simple FSMs
• Priority Stoplight
![Page 15: Simple Finite State Machines](https://reader033.vdocuments.us/reader033/viewer/2022050612/6273f8ce1c62a0478171044f/html5/thumbnails/15.jpg)
15 © tjEE 3921
Simple FSMs
• Priority Stoplight
![Page 16: Simple Finite State Machines](https://reader033.vdocuments.us/reader033/viewer/2022050612/6273f8ce1c62a0478171044f/html5/thumbnails/16.jpg)
16 © tjEE 3921
• Priority Stoplight
Simple FSMs
normal cycle N/S Priority