EEE 70 Advanced Topics in Logic Design: Read Before Class
EEE 70 Advanced Topics in Logic Design: Read Before Class
Design
State diagram:
• Nodes: unique states of the FSM
• Transitional arcs: labeled with the condition that causes the
transition
Algorithmic State Machine (ASM) chart is an alternative
representation
• Composed of a network of ASM blocks
• ASM block:
State box: represents a state in the FSM
Optional network of decision boxes and conditional output boxes
A state diagram can be converted to an ASM chart and
vice-versa
State Graph ASM chart
entity fsm_eg is
port(
clk, reset: in std_logic;
a, b: in std_logic;
y0, y1: out std_logic
);
end fsm_eg;
begin
-- state register
process(clk,reset)
begin
if (reset='1') then
state_reg <= s0;
elsif (clk'event and clk='1') then
state_reg <= state_next;
end if;
end process;
VHDL code of example
-- next-state/output logic
process(state_reg,a,b)
begin
state_next <= state_reg; -- default back to same state
y0 <= '0'; -- default 0
y1 <= '0'; -- default 0
case state_reg is
when s0 =>
y1 <= '1';
if a='1' then
if b='1' then
state_next <= s2;
y0 <= '1';
else
state_next <= s1;
end if;
-- no else branch
end if;
when s1 =>
y1 <= '1';
if (a='1') then
state_next <= s0;
-- no else branch
end if;
when s2 =>
state_next <= s0;
end case;
end process;
end two_seg_arch;
Overview
Status signals
15 8 7 0 15 0
PC(H) PC(L) R2
K1
n Load
R1 R2
If (K1 =1) then (R2 R1)
K1: (R2 R1)
Clock
where K1 is a control
expression specifying a
conditional execution of Clock
the microoperation.
K1
Transfer Occurs Here
R1 R1 R2
(K1 + K2): R1 R1 R3
• On condition K1 OR K2, the content of R1 is Logic bitwise
ORed with the content of R3 and the result placed in R1.
• NOTE: "+" (as in K1 + K2) means “OR.” In R1 R1 + R2, +
means “plus”.
Arithmetic Microoperations
Symbolic Description
Designation
R0 R1 Bitwise NOT
R0 R1 R2 Bitwise OR (sets bits)
R0 R1 R2 Bitwise AND (clears bits)
R0 R1 R2 Bitwise EXOR (complements bits)
Shift Microoperations
Let R2 = 11001001
aa-b+1
Block diagram
Overview
entity fib is
VHDL code
port(
clk, reset: in std_logic;
start: in std_logic;
i: in std_logic_vector(4 downto 0);
ready, done_tick: out std_logic;
f: out std_logic_vector(19 downto 0)
);
end fib;
begin
-- output
f <= std_logic_vector(t1_reg);
end arch;
Summary