Lab01 - Introduction to VHDL
Lab01 - Introduction to VHDL
Hardware Description
Language
INTRODUCTION
• VHDL was designed in 1981 to describe
the functionality of hardware systems.
• VHDL is one the two most widely used
languages for hardware synthesis.
• VHDL is different from languages like C
in that it is intended to describe
hardware.
• Execution of a VHDL program results in
a simulation of the digital system.
2
VHDL as a language
• VHDL is a powerful language with numerous language
constructs that are capable of describing very complex
behavior.
• Learning all the features of VHDL is not a simple task.
• VHDL is a strongly typed language
• Type check at compile time.
• Allows user defined types.
• Not a Case Sensitive.
• Two consecutive dashes (--) is used for comment.
Describing Hardware in VHDL
• VHDL Descriptions consist of primary design units and secondary design
units.
• The primary design units are the Entity and the Package.
• The secondary design units are the Architecture and the Package Body.
4
Entity
• All designs are expressed in terms of entities.
5
Entity Declaration
entity EntityName is
port ( signalName1 , {signalName2},… : PortMode Datatype;
signalName3 , {signalName4},… : PortMode Datatype);
end EntityName;
6
Entity Declaration
• An entity declaration describes the interface of the component.
b <= “000000010010”;
b <= B”000000010010”;
b <= B”0000_0001_0010”;
b <= X”012”; -- hexadecimal
b <= O”0022”; -- Octal
Architectures
• The entity describes the interface to the VHDL model.
20
Architecture Body
• Four modeling styles
• Concurrent assignments (Dataflow)
• Interconnected component (Structure)
• Sequential assignment statements (Behavior)
• Combination of the above three
architecture ArchName of EntityName is
//signals declarations
-- signal identifier : datatype [ := expression ];
begin
….
….
End ArchName;
Concurrent Vs Sequential Execution
22
Concurrent Assignments
(Dataflow)
Example (1)
Example (2)
Example (3)
Concurrent Condition
Statement
When …… else
Syntax:
signalName <= expression_1 when condition_1 else
expression_2 when condition_2 else
expression_3 ;
Example (4)
a
B
C
d
With …… select
• Syntax:
• with expression select
signalName <= expression_1 when choice_1,
expression_2 when choice_2 ,
expression_3 when others;
Example (5)
a
B
C
d