Ic Overview Session14 FSM
Ic Overview Session14 FSM
1
COURSE INTRODUCTION
Khóa Học Thiết Kế Vi Mạch Cơ Bản - Trung Tâm Đào Tạo Thiết Kế Vi Mạch ICTC
2
COURSE INTRODUCTION
SUMMARY
HOMEWORK
QUESTION
SELF-LEARNING
3
Session 14: Finite State
Machine - FSM
4
FSM OVERVIEW
A game machine has 2 states: locked or unlocked. Normally, it is in the locked state; when a coin is
inserted, it unlocks. When the start button is pressed, it locks again. Design FSM to control this game
machine.
clk
rst_n lock
start
EXAMPLE OF FSM DESIGN
coin=1
coin=0 LOCK UNLOCK start=0
start=1
10
FSM TIMING DIAGRAM
{signal: [
{name: 'clk', wave: 'p..........'},
{name: 'rst_n', wave: '01.........'},
{name: 'coin', wave: '0...1.0....'},
{name: 'start', wave: '0......1.0.'},,
{name: 'state', wave: '=....=..=..',data:["LOCK","UNLOCK","LOCK"]},
{name: 'lock (mealy)', wave: '1...0..1...'},
{name: 'lock (moore)', wave: '1....0..1..'},
]}
11
FSM DESIGN EXAMPLE
13
FSM CLASSIFICATION
rst_n match
detect_string
stream
Example: match
110011001011001010101101101011111
match match match
Homework
Homework1:
▪ Finish the above practice. The output match is a Mealy FSM or Moore FSM using the parameter
define MEALY_FSM same as previous example.
▪ Write simple testbench to test the design with the above given stream.
16