VHDL Programming: (Vhsic Hardware Description Language)
VHDL Programming: (Vhsic Hardware Description Language)
• Verify design
• Synthesize circuits
• Convert from higher abstraction levels to lower abstraction levels
VHDL
• VHDL stands for very high-speed integrated circuit
hardware description language. It is a programming
language used to model a digital system by dataflow,
behavioral and structural style of modelling.
LIBRARY
• Describing a Design declarations
Basic
• Library ENTITY VHDL code
• Entity declaration
• Generic ARCHITECTURE
• Port
• Downto LIBRARY
• Map
• Architecture PACKAGE
• Begin •• FUNCTIONS
FUNCTIONS
• end •• COMPONENTS
COMPONENTS
•• PROCEDURES
PROCEDURES
•• CONSTANTS
CONSTANTS
•• TYPES
TYPES
VHDL
library IEEE;
use
IEEE.STD_LOGIC_1164.ALL
;
Library – “ library ”
• Used to designate the library used in your
design
entity entity_name is
port ( port_ID1: I/O option signal_type;
port_ID2: I/O option signal_type;
);
end entity_name;
Entity – “ entity “
• Defines the input and output of your
design. • Name of the circuit
• User-defined
• Filename same as circuit name
recommended
• Example:
• Circuit name: entity_name
• File name : entity_name.vhd
VHDL •• we
we indicate
the
indicate the
the input
input and
“Library”.
“Library”.
the data
data type
and output
type available
output ports
available at
ports an
an in
in
at
•• where
where wewe used
used std_logic
std_logic for
for all
all port
Port – “port” data types.
data types.
port
• A data object has a name and data type. The general syntax for the use of the data
object is as
• The constant objects are usually declared in the declarative part of the
architecture, entity, package, process, procedure and function. However, it can
also be declared in the package body, block, generate.
• The value of the constant object cannot be changed through the program. Its
syntax is as follows constant name : data type := initial value;
• The signal objects can be declared in the declarative part of the architecture. On the
other hand, the variable objects can be declared inside the sequential program
segments, like process, procedure, function.
• Variable object declarations may or may not include an initial value. Variable
objects are employed in sequential program units, such as function, procedure,
and process.
• Logical Operators
• Relational Operators
• Arithmetic Operators
• Concatenation Operator
Assignment Operators
• Operator “:=”
• We use operator “:=” for either initial value assignment or to assign a
value to a variable, constant or generic.
• Note that “:=” is used for signal objects only for initial value
assignment. It is not used for signal objects in any other cases.
VHDL
• Operator “<=”
• We use the operator “<=” to assign a value to a signal object.
• Operator “=>” and “others” keyword
• We use operator “=>” to assign values to vector elements. The operator
“=>” is usually employed with the reserved word others which indicates the
index values of the unassigned vector elements.
If
x <= “11111110”
then
y <= x sla 3
produces
y <=
“11110000”
VHDL If
x <= “01111111”
then
y <= x sra 3
produces
y <=
SRA: Shift Right Arithmetic “00001111”
• The bits are shifted to the right and new positions are filled by the value of the leftmost bit.
1). Select File > New Project... The New Project Wizard appears.
Creating a new project
1). Click the New Source button in the New Project Wizard.
Create an HDL Source
2). Select VHDL Module as the source type.
3). Type in the file name entity_name.
4). Click Next.
Create an HDL Source
5). The source file containing the entity/architecture pair displays in the Workspace, and the
entity_name displays in the Source tab, as shown below.
6). Click Next, then Finish in the New Source Wizard - Summary dialog box to complete
the new source file template.
Create an HDL Source
7). The source file containing the entity/architecture pair displays in the Workspace, and the
counter displays in the Source tab, as shown below
Create an HDL Source
ARCHITECTURE architecture_name OF entity_name IS
[declarations]
BEGIN
(code)
END architecture_name;