






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







ย ย
ย ย
defines types UNSIGNED and SIGNED as arrays of defines types UNSIGNED and SIGNED as arrays of
std_logic std_logic
type SIGNED is type SIGNED is
array(NATURAL array(NATURAL
range <>) of STD_LOGIC; range <>) of STD_LOGIC;
type UNSIGNED is type UNSIGNED is
array(NATURAL array(NATURAL
range <>) of STD_LOGIC; range <>) of STD_LOGIC;
ย ย
defines standard arithmetic and relational operators on defines standard arithmetic and relational operators on
these types these types
ย ย
ย ย
same as above except SIGNED/UNSIGNED are arrays of same as above except SIGNED/UNSIGNED are arrays of
bit bit
ย ย
(from Synopsis)
(from Synopsis)
ย ย
Non Non-
standard predecessor standard predecessor
of of
numeric_std numeric_std
/bit /bit
NUMERIC_STD package contents NUMERIC_STD package contents
ย ย
ย ย
Combinations of operands allowed: Combinations of operands allowed:
ย ย
SIGNED + SIGNED return SIGNED SIGNED + SIGNED return SIGNED
ย ย
SIGNED + INTEGER return SIGNED SIGNED + INTEGER return SIGNED
ย ย
INTEGER + SIGNED return SIGNED INTEGER + SIGNED return SIGNED
ย ย
ย ย
ย ย
ย ย
ย ย
library IEEE; use IEEE.STD_LOGIC_1164.all;use IEEE.NUMERIC_STD.all;entity Adder4 is
port ( in1, in2 : in
STD_LOGIC_VECTOR(3 downto 0) ;
mySum : out
(3 downto 0) ) ;
end Adder4;architecture Behave_B of Adder4 isbegin
mySum <=
STD_LOGIC_VECTOR(SIGNED(in1) + SIGNED(in2));
end Behave_B;
Type conversions
arrays of same dimension + elements of same type
Modeling Finite State Machines Modeling Finite State Machines
(Synchronous Sequential Circuits)
(Synchronous Sequential Circuits)
ย ย
FSM design & synthesis process:
FSM design & synthesis process:
ย ย
Synthesis steps 2
Synthesis steps 2-
6 can be automated,
6 can be automated,
given the state diagram
given the state diagram
Synchronous Sequential Circuit Synchronous Sequential Circuit
(FSM) Example
(FSM) Example
Present
state
Input
x
Next state/output
Model the next Model the next
state and output functions of the FSM state and output functions of the FSM
process (x, process (x,
pres_state pres_state
function inputs function inputs
begin begin
case case
pres_state pres_state
is is
describe each state describe each state
when A => if (x = when A => if (x =
) then) then
z <= z <=
next_state next_state
else else
(x = (x =
z <= z <=
next_state next_state
end if; end if;
(continue next slide for (continue next slide for
pres_state pres_state
= B and C) = B and C)
when B => if (x= when B => if (x=
โ โ
0 0
โ โ
) then) then
z <= z <=
โโ
00
โ โ
; ;
next_state next_state
<= A; <= A;
else else
z <= z <=
โโ
11
โ โ
; ;
next_state next_state
<= C; <= C;
end if; end if;
when C => if (x= when C => if (x=
โ โ
0 0
โ โ
) then ) then
z <= z <=
โโ
00
โ โ
; ;
next_state next_state
<= C; <= C;
else else
z <= z <=
โโ
11
โ โ
; ;
next_state next_state
<= A; <= A;
end if; end if;
end case; end case;
end process; end process;
end; end;