CH 3 VLS
CH 3 VLS
3
Introduction to VHDL
(14 Marks)
VHDL Verilog
Both of these HDLs are IEEE standards.
Using HDL, logic circuit is represented in its code
which is used for design entry.
This method can be used efficiently designing small as
well as large systems.
VHDL
type.
- set of declarations for particular model.
- Separate interface from implementation.
- allows declaration of global signals
For example- Clock
Continued…
Declaration Syntax
Package identifier is
Library
•Library is a collection of compiled VHDL units.
• Library should be declared before each entity of program.
The IEEE created the IEEE VHDL library and std_logic type in
standard 1164. This was extended by Synopsys; their extensions
are freely redistributable.
Parts of the IEEE library can be included in an entity by inserting
lines like these before your entity declaration:
library ieee;use ieee.std_logic_1164.all;use
ieee.std_logic_arith.all; No attempt has been made here to be
definitive or exhaustive. If you want real answers, read the source
code. Links to the code or instructions on how to get it are
provided for each section. The source is fairly readable to
someone who knows some VHDL.
VHDL Objects
VHDL objects are
1. Constants
2. Variables
3. Signals
4. Files
Constants
• Constant is the object which names specific value.
• Name assigned to a specific value of type.
• Allow for easy update and redability.
Syntax
Constsnt_name:type_name[:=value];
For Example
Constant PI : Real : = 3.14;
Constant speed : Integer;
Variables
• Variable provide convenient mechanism for local storage.
For example- loop counters, intermediate values.
• All variable assignments take place immediately.
• No user specified delay is occur.
Declaration syntax
VARIABLE variable _name: type _name[ := value]
For example
VARIABLE opcode : BIT_VECTOR (3 downto 00) :=“ 0000”;
VARIABLE Freq :Integer;
Signals
• Signals used for communication between VHDL
components.
•Real, Physical signals in system often mapped to VHDL
signals.
• All VHDL signal signment require either delta cycle or
user specified delay before new value is assumed.
Declaration Syntax
signal_ name : type_name[:=value];
For Example
SIGNAL brdy : BIT
Brdy <= ‘ 0’ AFTER 5ns,’1’ AFTER 10ns;
File
• Files provide a way for a VHDL design to
communicate with the host environment
• File declarations make a file available for use
to a design
• Files can be opened for reading and writing
– In VHDL87, files are into and out of
scope
– In VHDL93 explicit FILE_OPEN() and
FILE_CLOSE() procedures opened and closed when
their associated objects come were added
• The package STANDARD defines basic file
I/O routines for VHDL types
Data Types
• All the objects, the signal, the variable and the
constants can be declared using a type specification
to specify the characteristic of the the object.
• VHDL contains a wide range of types that can be
used to create simple or complex objects.
A type declaration
Type type_name is type_mark
Continued….
Scalar Type
• Scalar type describe objects that can hold, at most, one value at a time.
• The type itself contain multiple values, but an object that is declared to
be a scalar type can hold , at most , one of the scalar values at any point
at that time.
Scalar Types
1. Integer- Specified integer range
2. Real Types- Mathematical real numbers
( e.g.0.0 to 35.7)
3. Enumerated Types- Set of user defined values
(e.g. add,mul,div,u- uninitiated,x- unknown,0-logic ‘0’,
1- logic’1’etc)
4. Physical Tyapes- Measurement of some physical quantity
(e.g.length,time,voltage,current etc.)
Composite Type