ECE448 Lecture9 ASM
ECE448 Lecture9 ASM
Required reading
P. Chu, FPGA Prototyping by VHDL Examples Chapter 5, FSM S. Brown and Z. Vranesic, Fundamentals of Digital Logic with VHDL Design Chapter 8.10, Algorithmic State Machine (ASM) Charts
0 (False)
Condition expression
1 (True)
(c) Conditional output box ECE 448 FPGA and ASIC Design with VHDL
State Box
State box represents a state. Equivalent to a node in a state diagram or a row in a state table. Contains register transfer actions or output signals Moore-type outputs are listed inside of the box. It is customary to write only the name of the signal that has to be asserted in the given state, e.g., z instead of z<=1. Also, it might be useful to write an action to be taken, e.g., count <= count + 1, and only later translate it to asserting a control signal that causes a given action to take place (e.g., enable signal of a counter).
ECE 448 FPGA and ASIC Design with VHDL State name Output signals or actions (Moore type)
Decision Box
Decision box indicates that a given condition is to be tested and the exit path is to be chosen accordingly The condition expression may include one or more inputs to the FSM.
ECE 448 FPGA and ASIC Design with VHDL
0 (False)
Condition expression
1 (True)
C z = 1
w = 1
10
Output z 0 0 1
11
w 1 B
w 1
C z
12
ARCHITECTURE Behavior OF simple IS TYPE State_type IS (A, B, C) ; SIGNAL y : State_type ; BEGIN PROCESS ( resetn, clock ) BEGIN IF resetn = '0' THEN y <= A ; ELSIF (Clock'EVENT AND Clock = '1') THEN
ECE 448 FPGA and ASIC Design with VHDL 13
15
Reset w = 1 z = 0 w = 0 z = 0 A w = 0 z = 0 B w = 1 z = 1
16
0 w 1
B z
17
ARCHITECTURE Behavior OF Mealy IS TYPE State_type IS (A, B) ; SIGNAL y : State_type ; BEGIN PROCESS ( resetn, clock ) BEGIN IF resetn = '0' THEN y <= A ; ELSIF (clock'EVENT AND clock = '1') THEN
ECE 448 FPGA and ASIC Design with VHDL 18
19
20
r1 r2 r3
g1
Arbiter
g2 g3
clock
ECE 448 FPGA and ASIC Design with VHDL 21
0xx
1xx
gnt1 g1 = 1
x0x
1xx
gnt2 g2 = 1 x1x
01x
xx0
001
gnt3 g3 = 1
xx1
ECE 448 FPGA and ASIC Design with VHDL 22
r 1r 2
r 1r 2 r 3
r1 0
1 gnt1 g1 1 gnt2 g2 1 r2 0 1 r1 0
r2 0
0 r3
1 gnt3 g3 1 0 r3
24
: IN : IN : OUT
ARCHITECTURE Behavior OF arbiter IS TYPE State_type IS (Idle, gnt1, gnt2, gnt3) ; SIGNAL y : State_type ;
25
26
27
Chapter 10
28