Hardware Description Language (HDL) Introduction To HDL
Hardware Description Language (HDL) Introduction To HDL
(HDL)
Introduction to HDL :
library LIBRARY_NAME;
use LIBRARY_NAME.PACKAGE NAME <list of definitions>
Library Clause
► The syntax for library clause is
library LIBRARY_NAME;
use LIBRARY_NAME.PACKAGE NAME <list of definitions>
Example:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
The work Library
use library_name.package_name.item;
use library_name.package_name;
use library_name.package_name.all;
USE Clause
► Example 1.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
► Example 2.
library IEEE;
use IEEE.STD_LOGIC_1164.STD_ULOGIC;
use IEEE.STD_LOGIC_1164.RISING_EDGE;
► In the first example all the declarations specified in
st_logic_1164(which belongs to the library IEEE) have been
made visible.
► The second example makes visible the RISING_EDGE function
which is declare in same package. The function uses the type
STD_ULOGIC, therefore declaration of this type is also made
visible
Packages
► A package is a collection of declarations that more than one
design can use.
► You can collect constant, data types, component declarations,
and subprograms into a VHDL package that can then be used
by more than one design or entity.
Package structure:
Packages have two parts, the declaration and the body.
► Package Declaration:
Holds public information, including constant, type and
subprogram declarations.
► Package body :
holds private information, including local types and
subprogram implementations.
Package declarations:
► Package declaration defines the interface to a package.
► Package declarations collect information that is needed by
one or more entities in a design.
► This information includes data type declaration, signal
declarations, subprogram declarations and components
declarations.
► Signal declared in packages cannot be shared across entities.
► The syntax of package declaration is:
package package_name is
{ use clause ( to include other package)
type declaration
subtype declaration
constant declaration
signal declaration
subprogram declaration
component declaration }
end [package_name]
Package body:
► A package body is the bodies of subprograms and the values
of constant declared in the package.
► A package body includes, implementation of subprograms
declared in the package declaration and internal support
programs
► The syntax of package body is