Académique Documents
Professionnel Documents
Culture Documents
Marios S. Pattichis
Contents
• Introduction
• How to Define a Comment
• Basic Definitions
• The entity command
• Input/Output Signals
• Function calls using port map
• Defining Architectures
• Defining Functions
• An Example of a Multiplier in Behavioral Style
Introductory Comments on Hardware Description Languages
Examples:
-- This comment starts at the beginning of a line.
A <= B+C; -- This comment starts at the end of a command line.
Examples:
subtype unsignedTwoBit is integer range 0 to 3
subtype bitNumber is integer range 1 downto 0
General form:
sum <= transport value-expression after time-expression;
Rejection time: 1 ns
Propagation delay: 2 ns
Two More Examples of Signal Assignment
Example 2:
sum <= A and B after 2 ns;
-- assumes that:
-- rejection time = 2 ns
-- propagation delay time = 2 ns
-- inertial delay model is applied to decide output
Example 3:
sum <= A and B;
-- assumes that:
-- rejection time = Delta Time (internal constant)
-- propagation delay time = Delta Time
-- inertial delay model is applied to decide output
General Form:
signal signal-list : signal-type := valid-initial-expression;
Options for Signals (modeType)
Every signal can be defined using any one of the following:
Notes:
• text enclosed in square brackets ([..]) is optional
• generic is a list of constant design parameters (not variables)
• port defines the input/output signals
How to Make a Call Using port map
We can call a function (defining a component), after it has been
defined, using:
UniqueLabel1: componentName1 port map (firstSignal1, …,
firstSignalN);
:
UniqueLabelN: componentNameN port map (lastSignal1, …,
lastSignalN);
Then, we can create the component using the following call as in “C”:
JK_FF port map (Clkin, Jin, Kin, Resetin, Qout, Qinvout);
subprogram_body <=
procedure identifier [ (parameter_interface_list) ] is
{subprogram_declarative_part}
begin
{sequential_statement}
end [ procedure ] [ identifier ];
Notes:
• Note that procedures are subprograms
• Execution in procedures is sequential
• Variables in procedures are dynamic. They behave as in C.
• They generalize statements
A General Framework for Defining Functions
Function functionName(
signal List1: signal Type;
:
signal ListN: signal Type)
Return returnType is
Various Declerations -- definitions if needed
begin
sequential Statement1 -- sequential execution as in C
:
sequential StatementN
end function Name;
-- Inside the functions, all instructions are executed sequentially, like "C".
-- Functions generalize expressions. They are considered subprograms
A Framework of an Architecture Definition
architecture architectureName of entityName is Various Declarations
-- different definitions given here …
begin
Concurrent Statement 1 -- Everything gets executed in
:
Concurrent StatementN -- parallel until there is no change
end architectureName
Function arguments:
OK to call with the same type or subtype
A Simple Example: A Multiplier Using Behavioral Style
(Wakerly, page 453)
entity unsignedMul8x8 is
port ( X: in UNSIGNED(7 downto 0); -- eight bits input
Y: in UNSIGNED(7 downto 0); -- eight bits input
P: out UNSIGNED(15 downto 0)); -- sixteen bits output
end unsignedMul8x8