SlideShare a Scribd company logo
VERY HIGH SPEED INTEGRATED CIRCUIT
HARDWARE DESCRIPTION LANGUAGE
LECTURE - II
Presented By :
Parag Parandkar
Assistant Professor & Head,
ECE Department,
Oriental University, Indore, M.P. , India
ACKNOWLEDGEMENT
The Presenter would like to thank and
acknowledge the power point presentation
slides of VHDL – A Comprehensive tutorial by
anonymous.
CONTENTS
 Subprogram
 Function and Procedure
 Package
Package declaration and Package
Body
 Use Clause
 Analysis Rule for Units
 Objects and Data Types
 Scalar Type
 Literal
SUBPROGRAMS
Subprograms are of two types :
- functions and procedures
A subprogram consists of a sequence of
declarations and statements which can be repeated
from different locations in VHDL descriptions
subprograms can be overloaded
functions can be used for operator overloading
procedures can assign values to its parameter
objects while functions can not
A subprogram can be separated into its
subprogram declaration and subprogram body
SUBPROGRAMS (CONTD.)
Full form of subprogram declaration is
 subprogram-specification;
Two forms of subprogram - specification
procedure identifier interface_list
[pure | impure] function identifier interface_list
return type_mark
Full form of subprogram body is
subprogram-specification is
 declarations
begin
 statements
end identifier;
FUNCTIONS
 Intended to be used strictly for computing values and not
for changing value of any objects associated with the
function’s formal parameters
 All parameters must be of mode in and class signal or
constant or File.
 If no mode is specified, the parameter is interpreted as
having mode in. If no class is specified parameters are
interpreted as being of class constant. Parameter of type
FILE has no mode.
 Examples of function declaration
Object class of parameter is implicit
function Mod_256 (X : Integer) return Byte;
Object class of parameter is explicit
function Mod_256(constant X : in Integer) return Byte;
EXAMPLE
Function declaration
function Min (X, Y : Integer) return Integer;
-- Function Specification
function Min (X, Y : Integer) return Integer is
begin
if (X < Y) then
return X;
else
return Y;
end if;
end Min;
PROCEDURES
 Procedures are allowed to change the values of the
objects associated with its formal parameters
 Parameters of procedures may of mode in, out or inout
 If no mode is specified the parameter is interpreted as
having mode in. If no class is specified parameters of
mode in are interpreted as being of class constant and
parameters of mode out or inout are interpreted as being
of class variable. Parameter of type FILE has no mode.
 Examples of procedure declaration
Object class of parameter is implicit
procedure Mod_256 (X : inout Integer);
Object class of parameter is explicit
procedure Mod_256(variable X : inout Integer);
EXAMPLE
Procedure declaration
--- X is of class variable
Procedure ModTwo (X : inout Integer);
-- Procedure Specification
Procedure ModTwo (X : inout Integer) is
begin
case X is
When 0 | 1 => null;
When others X := X mod 2;
end case;
end ModTwo;
PACKAGES
Allows data types, subprograms, object
declarations (signal, constants, shared variables and
files), component declarations etc. to be shared
by multiple design units.
package identifier is
 declarations
end [package] [identifier];
 Example :
package logic is
 type Three_level_logic is (‘0’, ‘1’, ‘z’);
 function invert (Input : Three_level_logic) return
Three_level_logic;
end logic;
PACKAGE BODY
Package declarations and bodies are separately
described
Package declarations contain public and visible
declarations
Items declared inside package body is not visible
outside the package body
Package body has the same name as the
corresponding package declaration
package body identifier is
 declarations
end [package body] [identifier];
PACKAGE BODY (CONTD.)
 Example of a package body for package logic
package body logic is
-- subprogram body of function invert
function invert (Input: Three_level_logic) return
Three_level_logic is
begin
case Input is
when ‘0’ => return ‘1’;
when ‘1’ => return ‘0’;
when ‘Z’ => return ‘Z’;
end invert;
end logic;
USE CLAUSE
 Use clause preceding an unit makes all the elements of a
package or a particular element of a package visible to
the unit
 An architecture body inherits the use clauses of its
entity. So if those use clauses are sufficient for the
descriptions inside the architecture, then no explicit use
clause is necessary for the architecture
 Simple examples :
Makes all items of package std_logic_1164 in library
ieee visible
use ieee.std_logic_1164.all;
Makes Three_level_logic in package Logic in library
work visible
use work.Logic.Three_level_logic;
USE CLAUSE (CONTD.)
library my_lib;
use my_lib.Logic.Three_level_logic;
use my_lib.Logic.Invert;
entity Inverter is
port (X : in Three_level_logic;
Y : out Three_level_logic);
end inverter;
ANALYSIS RULES FOR UNITS
 Units can be separately analyzed provided following rules are
obeyed
 a secondary unit can be analyzed only after its primary unit is
analyzed
 a library unit that references another primrary unit can be
analyzed only after the referred unit has been analyzed
 an entity, architecture, configuration referenced in a
configuration declaration must be analyzed before the
configuration declaration is analyzed
 A library clause makes library visible and an use clause makes
the units inside the library visible to other units
library Basic_Library;
Use Basic_Library.Logic;
Use Logic.all;
OBJECTS AND DATA TYPES
 Something that can hold a value is an object (e.g signal)
 In VHDL, every object has a type, the type determining
the kind of value the object can hold
 VHDL is strongly typed language
 The type of every object and expression can be
determined statically. i.e the types are determined prior
to simulation.
 Three basic VHDL data types are
integer types
floating point types
enumerated types
 Data types can be user defined
DATA TYPES
Data type
Scalar Type Composite TypeAccess Type File Type
Integer
Float
Physical
Enumeratio
n
Record
Array
Integer and enumeration types are called discrete types
Integer, Real and Physical types are called numeric types
DATA TYPES(CONTD.)
 Scalar Type
Most atomic
Can be ordered along a single scale
Integer types
type Byte is range -128 to 127;
type Bit_pos is range 7 downto 0;
Floating types
type fraction_type is range 100.1 to 200.1;
Enumerated Types
consists of enumeration literal
a literal is either an identifier or a character literal
type Three_Level_Logic is (‘0’, ‘1’, ‘z’);
type Color_set is (RED, GREEN, BLUE);
DATA TYPES : SCALAR TYPE
(CONTD.)
Physical Type
Values of physical type represent measurement of some physical
quantity such as time, distance etc.
Any value of a physical type is an integral multiple of the
primary unit of measurement for the type
Example
 type Time is range -(2**31 -1) to (2**31 -1)
 units
 fs ; --- primary unit
 ps = 1000 fs; --- secondary unit
 ns = 1000 ps; --- secondary unit
 end units;
LITERAL
 These are symbols whose value is immediately evident
from the symbol
 Six Literal Types
integer, floating, characters, strings,
bit_string and physical literal;
 Examples
 2 19878 16#D2# 8#720#
2#1000100
 1.9 65971.3333 8#43.6#e+4 43.6E-4
 “ABC()%”
 B”1100” X”Ff” O”70”
 15 ft 10 ohm 2.3 sec

More Related Content

PDF
Vhdl introduction
PPTX
the-vhsic-.pptx
PPTX
PPT ON VHDL subprogram,package,alias,use,generate and concurrent statments an...
PPS
Procedures functions structures in VB.Net
PDF
Java q ref 2018
PPTX
Structured Languages
PPT
VHDLhshdhdbbdbdbdbdbdbdbbdbrbrbrbfbfbbfb_PPT.ppt
PPTX
Lecture2_MCS4_Evening.pptx
Vhdl introduction
the-vhsic-.pptx
PPT ON VHDL subprogram,package,alias,use,generate and concurrent statments an...
Procedures functions structures in VB.Net
Java q ref 2018
Structured Languages
VHDLhshdhdbbdbdbdbdbdbdbbdbrbrbrbfbfbbfb_PPT.ppt
Lecture2_MCS4_Evening.pptx

Similar to VHDL lecture 2.ppt (20)

PPTX
program fundamentals using python1 2 3 4.pptx
PPT
Generics_RIO.ppt
PPTX
Notes(1).pptx
PPTX
functions new.pptx
DOCX
PPTX
VHDL for beginners in Printed Circuit Board designing
PDF
VHDL-Behavioral-Programs-Structure of VHDL
PPT
C#3.0 & Vb 9.0 New Features
PDF
C Sharp: Basic to Intermediate Part 01
PPTX
04. WORKING WITH FUNCTIONS-2 (1).pptx
PPT
VB.net
PPTX
PDF
Opps concept
PPTX
Operator Overloading and Scope of Variable
PPTX
java Basic Programming Needs
PPT
VHDL lecture 1.ppt
PPTX
OOC MODULE1.pptx
PDF
functions-.pdf
PPTX
oop lecture 3
program fundamentals using python1 2 3 4.pptx
Generics_RIO.ppt
Notes(1).pptx
functions new.pptx
VHDL for beginners in Printed Circuit Board designing
VHDL-Behavioral-Programs-Structure of VHDL
C#3.0 & Vb 9.0 New Features
C Sharp: Basic to Intermediate Part 01
04. WORKING WITH FUNCTIONS-2 (1).pptx
VB.net
Opps concept
Operator Overloading and Scope of Variable
java Basic Programming Needs
VHDL lecture 1.ppt
OOC MODULE1.pptx
functions-.pdf
oop lecture 3
Ad

Recently uploaded (20)

PDF
ICT grade for 8. MATATAG curriculum .P2.pdf
PDF
SAHIL PROdhdjejss yo yo pdf TOCOL PPT.pdf
PDF
ISS2022 present sdabhsa hsdhdfahasda ssdsd
PPTX
rorakshsjppaksvsjsndjdkndjdbdidndjdbdjom.pptx
PPTX
unit1d-communitypharmacy-240815170017-d032dce8.pptx
PPTX
Group 4 [BSIT-1C] Computer Network (1).pptx
DOCX
Edukasi kultural untuk kita semua maka c
PPTX
New professional education PROF-ED-7_103359.pptx
PPTX
DEATH AUDIT MAY 2025.pptxurjrjejektjtjyjjy
PPTX
5. MEASURE OF INTERIOR AND EXTERIOR- MATATAG CURRICULUM.pptx
PPTX
Lecture-3-Computer-programming for BS InfoTech
PPTX
Unit-1.pptxgeyeuueueu7r7r7r77r7r7r7uriruru
PPTX
Fundamentals of Computer.pptx Computer BSC
PDF
2_STM32&SecureElements2_STM32&SecureElements
PPTX
A Clear View_ Interpreting Scope Numbers and Features
PPTX
"Fundamentals of Digital Image Processing: A Visual Approach"
PDF
Dozuki_Solution-hardware minimalization.
PDF
Topic-1-Main-Features-of-Data-Processing.pdf
DOCX
A PROPOSAL ON IoT climate sensor 2.docx
PPTX
Computers and mobile device: Evaluating options for home and work
ICT grade for 8. MATATAG curriculum .P2.pdf
SAHIL PROdhdjejss yo yo pdf TOCOL PPT.pdf
ISS2022 present sdabhsa hsdhdfahasda ssdsd
rorakshsjppaksvsjsndjdkndjdbdidndjdbdjom.pptx
unit1d-communitypharmacy-240815170017-d032dce8.pptx
Group 4 [BSIT-1C] Computer Network (1).pptx
Edukasi kultural untuk kita semua maka c
New professional education PROF-ED-7_103359.pptx
DEATH AUDIT MAY 2025.pptxurjrjejektjtjyjjy
5. MEASURE OF INTERIOR AND EXTERIOR- MATATAG CURRICULUM.pptx
Lecture-3-Computer-programming for BS InfoTech
Unit-1.pptxgeyeuueueu7r7r7r77r7r7r7uriruru
Fundamentals of Computer.pptx Computer BSC
2_STM32&SecureElements2_STM32&SecureElements
A Clear View_ Interpreting Scope Numbers and Features
"Fundamentals of Digital Image Processing: A Visual Approach"
Dozuki_Solution-hardware minimalization.
Topic-1-Main-Features-of-Data-Processing.pdf
A PROPOSAL ON IoT climate sensor 2.docx
Computers and mobile device: Evaluating options for home and work
Ad

VHDL lecture 2.ppt

  • 1. VERY HIGH SPEED INTEGRATED CIRCUIT HARDWARE DESCRIPTION LANGUAGE LECTURE - II Presented By : Parag Parandkar Assistant Professor & Head, ECE Department, Oriental University, Indore, M.P. , India
  • 2. ACKNOWLEDGEMENT The Presenter would like to thank and acknowledge the power point presentation slides of VHDL – A Comprehensive tutorial by anonymous.
  • 3. CONTENTS  Subprogram  Function and Procedure  Package Package declaration and Package Body  Use Clause  Analysis Rule for Units  Objects and Data Types  Scalar Type  Literal
  • 4. SUBPROGRAMS Subprograms are of two types : - functions and procedures A subprogram consists of a sequence of declarations and statements which can be repeated from different locations in VHDL descriptions subprograms can be overloaded functions can be used for operator overloading procedures can assign values to its parameter objects while functions can not A subprogram can be separated into its subprogram declaration and subprogram body
  • 5. SUBPROGRAMS (CONTD.) Full form of subprogram declaration is  subprogram-specification; Two forms of subprogram - specification procedure identifier interface_list [pure | impure] function identifier interface_list return type_mark Full form of subprogram body is subprogram-specification is  declarations begin  statements end identifier;
  • 6. FUNCTIONS  Intended to be used strictly for computing values and not for changing value of any objects associated with the function’s formal parameters  All parameters must be of mode in and class signal or constant or File.  If no mode is specified, the parameter is interpreted as having mode in. If no class is specified parameters are interpreted as being of class constant. Parameter of type FILE has no mode.  Examples of function declaration Object class of parameter is implicit function Mod_256 (X : Integer) return Byte; Object class of parameter is explicit function Mod_256(constant X : in Integer) return Byte;
  • 7. EXAMPLE Function declaration function Min (X, Y : Integer) return Integer; -- Function Specification function Min (X, Y : Integer) return Integer is begin if (X < Y) then return X; else return Y; end if; end Min;
  • 8. PROCEDURES  Procedures are allowed to change the values of the objects associated with its formal parameters  Parameters of procedures may of mode in, out or inout  If no mode is specified the parameter is interpreted as having mode in. If no class is specified parameters of mode in are interpreted as being of class constant and parameters of mode out or inout are interpreted as being of class variable. Parameter of type FILE has no mode.  Examples of procedure declaration Object class of parameter is implicit procedure Mod_256 (X : inout Integer); Object class of parameter is explicit procedure Mod_256(variable X : inout Integer);
  • 9. EXAMPLE Procedure declaration --- X is of class variable Procedure ModTwo (X : inout Integer); -- Procedure Specification Procedure ModTwo (X : inout Integer) is begin case X is When 0 | 1 => null; When others X := X mod 2; end case; end ModTwo;
  • 10. PACKAGES Allows data types, subprograms, object declarations (signal, constants, shared variables and files), component declarations etc. to be shared by multiple design units. package identifier is  declarations end [package] [identifier];  Example : package logic is  type Three_level_logic is (‘0’, ‘1’, ‘z’);  function invert (Input : Three_level_logic) return Three_level_logic; end logic;
  • 11. PACKAGE BODY Package declarations and bodies are separately described Package declarations contain public and visible declarations Items declared inside package body is not visible outside the package body Package body has the same name as the corresponding package declaration package body identifier is  declarations end [package body] [identifier];
  • 12. PACKAGE BODY (CONTD.)  Example of a package body for package logic package body logic is -- subprogram body of function invert function invert (Input: Three_level_logic) return Three_level_logic is begin case Input is when ‘0’ => return ‘1’; when ‘1’ => return ‘0’; when ‘Z’ => return ‘Z’; end invert; end logic;
  • 13. USE CLAUSE  Use clause preceding an unit makes all the elements of a package or a particular element of a package visible to the unit  An architecture body inherits the use clauses of its entity. So if those use clauses are sufficient for the descriptions inside the architecture, then no explicit use clause is necessary for the architecture  Simple examples : Makes all items of package std_logic_1164 in library ieee visible use ieee.std_logic_1164.all; Makes Three_level_logic in package Logic in library work visible use work.Logic.Three_level_logic;
  • 14. USE CLAUSE (CONTD.) library my_lib; use my_lib.Logic.Three_level_logic; use my_lib.Logic.Invert; entity Inverter is port (X : in Three_level_logic; Y : out Three_level_logic); end inverter;
  • 15. ANALYSIS RULES FOR UNITS  Units can be separately analyzed provided following rules are obeyed  a secondary unit can be analyzed only after its primary unit is analyzed  a library unit that references another primrary unit can be analyzed only after the referred unit has been analyzed  an entity, architecture, configuration referenced in a configuration declaration must be analyzed before the configuration declaration is analyzed  A library clause makes library visible and an use clause makes the units inside the library visible to other units library Basic_Library; Use Basic_Library.Logic; Use Logic.all;
  • 16. OBJECTS AND DATA TYPES  Something that can hold a value is an object (e.g signal)  In VHDL, every object has a type, the type determining the kind of value the object can hold  VHDL is strongly typed language  The type of every object and expression can be determined statically. i.e the types are determined prior to simulation.  Three basic VHDL data types are integer types floating point types enumerated types  Data types can be user defined
  • 17. DATA TYPES Data type Scalar Type Composite TypeAccess Type File Type Integer Float Physical Enumeratio n Record Array Integer and enumeration types are called discrete types Integer, Real and Physical types are called numeric types
  • 18. DATA TYPES(CONTD.)  Scalar Type Most atomic Can be ordered along a single scale Integer types type Byte is range -128 to 127; type Bit_pos is range 7 downto 0; Floating types type fraction_type is range 100.1 to 200.1; Enumerated Types consists of enumeration literal a literal is either an identifier or a character literal type Three_Level_Logic is (‘0’, ‘1’, ‘z’); type Color_set is (RED, GREEN, BLUE);
  • 19. DATA TYPES : SCALAR TYPE (CONTD.) Physical Type Values of physical type represent measurement of some physical quantity such as time, distance etc. Any value of a physical type is an integral multiple of the primary unit of measurement for the type Example  type Time is range -(2**31 -1) to (2**31 -1)  units  fs ; --- primary unit  ps = 1000 fs; --- secondary unit  ns = 1000 ps; --- secondary unit  end units;
  • 20. LITERAL  These are symbols whose value is immediately evident from the symbol  Six Literal Types integer, floating, characters, strings, bit_string and physical literal;  Examples  2 19878 16#D2# 8#720# 2#1000100  1.9 65971.3333 8#43.6#e+4 43.6E-4  “ABC()%”  B”1100” X”Ff” O”70”  15 ft 10 ohm 2.3 sec