VHDL 1 Introduction
VHDL 1 Introduction
with VHDL
Reference: Roth & John text – Chapter 2
Michael Smith text – Chapters 8 & 10
Hardware Description Languages
VHDL = VHSIC Hardware Description Language
(VHSIC = Very High Speed Integrated Circuits)
Developed by DOD from 1983 – based on ADA language
IEEE Standard 1076-1987/1993/2002/2008
Gate level through system level design and verification
Full Adder
A
Sum
Input Output
B
“ports” “ports”
Cout
Cin
Cout
IEEE std_logic_1164 package
-- IEEE std_logic_1164 package defines nine logic states for signal values
-- models states/conditions that cannot be represented with the BIT type
-- VHDL “package” similar to a C “include” file
package Part_STD_LOGIC_1164 is
type STD_ULOGIC is ( 'U', -- Uninitialized/undefined value
'X', -- Forcing Unknown
'0', -- Forcing 0 (drive to GND)
'1', -- Forcing 1 (drive to VDD)
'Z', -- High Impedance (floating, undriven, tri-state)
'W', -- Weak Unknown
'L', -- Weak 0 (resistive pull-down)
'H', -- Weak 1 (resistive pull-up)
'-' -- Don't Care (for synthesis minimization)
);
subtype STD_LOGIC is resolved STD_ULOGIC; --see next slide
type STD_LOGIC_VECTOR is array (NATURAL range <>) of STD_LOGIC;
Driver L Driver
A B
Driver B value
‘0’ ‘1’ ‘Z’ ‘X’
Driver A:
L <= A; ‘0’ ‘0’ ‘X’ ‘0’ ‘X’ Resolved
Driver A
Driver B:
value
‘1’ ‘X’ ‘1’ ‘1’ ‘X’ Bus
L <= B; Values
‘Z’ ‘0’ ‘1’ ‘Z’ ‘X’ for signal
‘X’ ‘X’ ‘X’ ‘X’ ‘X’ L
Example: 1-Bit Full Adder
library ieee; --supplied library
use ieee.std_logic_1164.all; --package of definitions
entity full_add1 is
port ( -- I/O ports
a: in std_logic; -- addend input
b: in std_logic; -- augend input
cin: in std_logic; -- carry input
sum: out std_logic; -- sum output
cout: out std_logic); -- carry output
end full_add1 ;
Example: 8-bit full adder
library ieee; -- supplied library
use ieee.std_logic_1164.all; -- package of definitions
a
b
c
T T+1 T+2 T+3
Event-Driven Simulation Example
a <= b; -- delay δ inserted
c <= a; -- delay δ inserted
Time a b c
T-1 ‘0’ ‘0’ ‘0’ - assume initial values all ‘0’
T ‘0’ ‘1’ ‘0’ - external event changes b at time T
T+δ ‘1’ ‘1’ ‘0’ - resulting event on a after δ delay
T+2δ ‘1’ ‘1’ ‘1’ - resulting event on c after 2nd δ delay
VHDL simulators generally show time and ∂ delays
a
b
c
T-1 T T+δ T+2δ