VHDL
VHDL
VHDL
C
C = A AND B
NOTE:
IF B = 0 , C = 0
IF B = 1 , C = A
THEREFORE:
AND GATE IS COMMONLY
USED AS A CONTROLLED
BUFFER
OR GATE
VHDL C
C = A OR B C
TERMINOLOGY
HDL- HARDWARE DESCRIPTION LANGUAGE
- IS A SOFTWARE PROGRAMMING LANGUAGE THAT IS USED TO MODEL A
PIECE OF HARDWARE
BEHAVIOR MODELLING
- A COMPONENT DESCRIBED ITS INPUT/OUTPUT RESPONSE.
STRUCTURAL MODELLING
- A COMPONENT IS DESCRIBED BY INTERCONNECTING LOWER LEVEL
COMPONENTS/ PRIMITIVES.
REGISTER TRANSFER LEVEL (RTL)
A TYPE OF BEHAVIORAL MODELLING FOR THE PURPOSE OF SYNTHESIS.
SYNTHESIS
-TRANSLATING HDL TO A CIRCUIT AND THEN OPTIMIZING REPRESENTED
CIRCUIT.
PROCESS
- BASIC UNIT OF EXECUTION IN VHDL
4 VHDL DESIGN UNITS
• ENTITY
- USE TO DEFINE EXTERNAL VIEW OF A MODEL
• ARCHITECTURE
- USE TO DEFINE FUNCTION OF A MODEL
• CONFIGURATION
- USED TO ASSOCIATE ARCHITECTURE WITH AN
ENTITY.
• PACKAGE
- COLLECTION OF INFORMATION THAT CAN BE
REFERENCED BY VHDL MODELS.
Signal Assignment Operator
To assign a value to a signal data object in VHDL,
we use the
signal assignment operator
<=
Example:
;
VHDL Comment Operator
To include a comment in VHDL, use the
comment operator
-- This is a comment
-- This is an example of a comment
y <= 0; -- can occur at any point
Input-Output specification of circuit
Example: my_ckt
Inputs: A, B, C
Outputs: X, Y
A VHDL description:
X
B my_ckt entity my_ckt is
Y port (
S A: in bit;
B: in bit;
S: in bit;
X: out bit;
Y: out bit);
end my_ckt ;
• Entity
the “symbol” (input/output ports)
• Architecture
one of the several possible implementation of the
design
• Configuration
binding between the symbol and one of the many
possible implementation.
Can be used to express hierarchy.
19
VHDL Design Organization
• Libraries
logical units that are mapped to physical directories. The units of a library are called packages.
• Packages
repositories for type definitions, procedures, and functions
• Libraries and packages can be system defined or user defined
package
package
specification of the
declaration
package contents
20
Design Units
• Primary design units (not dependent on other design units)
– Entity
– Configuration
– Package Declaration
entity mux is
MUX port (
a: in std_logic;
A b: in std_logic;
B F s: in std_logic;
S f: out std_logic
)
end mux;
22
Architecture
23
Architecture #2
architecture rtl of mux is
begin
mux_p: process (a,b,s)
begin
if (s=‘1’) then
f <= a;
else
f <= b;
end if;
end process mux_p;
end rtl;
24
Configuration
25