SlideShare a Scribd company logo
1 of 24
VHDL
 V-VHSIC- VERY HIGH SPEED INTERGRATED CIRCUIT
 HDL- HARD WARE DISCRIPTION LANGUAGE
*VHDL AND VERILOG HDL FOR DEVELOPMENT AND
DESIGN
SYSTEM VERILOG FOR VERIFICATION
It can be model a digital system at many level of
abstraction ranging from algorithmic level to gate level
History of VHDL
 IT WAS FIRST GENRATION 1981
 THREE COMPANIES IBM,TEXAS INS. AND INTERMETRICS.
 DEVELOPED VERSION 7.2 OF VHDL – 1985
COMPARSIONOF VHDL AND
VERILOG
VHDL VERILOG HDL
Depends on library function It is independent of library
Body consisted of two parts Entire body defined as module
Case insensitivity ( upper and lower
case)
Case insensitivity
Library need for vhdl Library not need
It is free language Structural language
Different b/w Verilog and vhdl
Fuction Vhdl verilog
AND GATE AND &
OR GATE OR !
NAND NAND ~ &
NOR NOR ~ !
XOR XOR ^
XNOR XNOR ~^
NOT NOT ~
 Vhdl provides 5 different type of primary constructs called design
units.
 Entity declaration
 Configuration declaration
 Architecture body
 Package declaration
 Package body
HARDWARE ABSTRACT DEVICE
DEVICE DEVICE MODELmodel
Digital
systems
External view
Internal view
ENTITY
DECLARATION
ARCHITECTURE A
B
Z
VHDL
PROGRA
M
MODELS IN VHDL
 STRUCTURAL MODEL
 DATAFLOW MODEL
 BEHAVIERAL MODEL
 HYBRID MODEL
 PHYSICAL MODEL
STRUCTURE OF VHDL PROGRAM
 Library declaration
 Entity
 Architecture body
BASIC STRUCTURE OF VHDL PROGRAM
 library IEEE;
 use IEEE.STD_LOGIC_1164.ALL;
 use IEEE.STD_LOGIC_ARITH.ALL;
 use IEEE.STD_LOGIC_UNSIGNED.ALL;
 Entity entity name is
 Port declaration; in type ;( data type)
 port declaration ; out type;
 End entity name;
 Architecture Arc name of entity name is
 Signal declaration;
 variable declaration;
 Constant declaration;
 Package declaration;
 Component declaration;
 Begin
 Statement port
 .
 End Arc name;
Half adder
A B SUM CARRY
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
HALF ADDER:
LOGIC DIAGRAM: TRUTH TABLE:
Dataflow Modeling: for half adder

 library IEEE;
 use IEEE.STD_LOGIC_1164.ALL;
 use IEEE.STD_LOGIC_ARITH.ALL;
 use IEEE.STD_LOGIC_UNSIGNED.ALL;
 entity hadd is
 Port ( a : in std_logic;
 b : in std_logic;
 sum : out std_logic;
 carry : out std_logic);
 end hadd;
 architecture dataflow of hadd is
 begin
 sum <= a xor b;
 carry <= a and b;
 end dataflow;
Behavioral modeling for half adder
Behavioral Modeling:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity haddbehavioral is
Port ( a : in std_logic;
b : in std_logic;
sum : out std_logic;
carry : out std_logic);
end haddbehavioral;
architecture Behavioral of haddbehavioral is
begin
p1:process (a,b)
begin
sum<= a xor b;
carry<= a and b;
end process p1;
end Behavioral;
Structural Modeling:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity haddstructural is
Port ( a : in std_logic;
b : in std_logic;
sum : out std_logic;
carry : out std_logic);
end haddstructural;
architecture structural of haddstructural is
component xor2
port(a,b:in std_logic;
z:out std_logic);
end component;
component and2
port(a,b:in std_logic;
z:out std_logic);
end component;
begin
x1: xor2 port map (a,b,sum);
a1: and2 port map (a,b,carry);
end structural;
and2 component source code:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity and2 is
Port ( a : in std_logic;
b : in std_logic;
z : out std_logic);
end and2;
architecture dataflow of and2 is
begin
z<= a and b;
end dataflow;
xor2 component source code:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity xor2 is
Port ( a : in std_logic;
b : in std_logic;
z : out std_logic);
end xor2;
architecture dataflow of xor2 is
begin
z<= a xor b;
end dataflow;
Dataflow Modeling:
half adder
Behavioral Modeling:
half adder
Structural Modeling:
half adder
module ha_dataflow(a, b, s, ca);
input a;
input b;
output s;
output ca;
assign#2 s=a^b;
assign#2 ca=a&b;
endmodule
module ha_behv(a, b, s, ca);
input a;
input b;
output s;
output ca;
reg s,ca;
always @ (a or b) begin
s=a^b;
ca=a&b;
end
endmodule
module ha_struct(a, b, s, ca);
input a;
input b;
output s;
output ca;
xor
x1(s,a,b);
and
a1(ca,a,b);
endmodule
VERILOG SOURCE CODE:
Gate code for verilog
 VERILOG SOURCE CODE:

 module logicgates1(a, b, c);
 input a;
 input b;
 OUTPUT: [6:0] c;
 assign c[0]= a & b;
 assign c[1]= a | b;
 assign c[2]= ~(a & b);
 assign c[3]= ~(a | b);
 assign c[4]= a ^ b;
 assign c[5]= ~(a ^ b);
 assign c[6]= ~ a;
 endmodule
TEST BENCH(VHDL):
 LIBRARY ieee;
 USE ieee.std_logic_1164.ALL;
 USE ieee.std_logic_unsigned.all;
 USE ieee.numeric_std.ALL;
 ENTITY test_bench_vhd IS
 END test_bench_vhd;
 ARCHITECTURE behavior OF test_bench_vhd IS
 COMPONENT hadd
 PORT(
 a : IN std_logic;
 b : IN std_logic;
 sum : OUT std_logic;
 carry : OUT std_logic
 );
 END COMPONENT;

 --Inputs
 SIGNAL a : std_logic := '0';
 SIGNAL b : std_logic := '0';

 --Outputs
 SIGNAL sum : std_logic;
 SIGNAL carry : std_logic;

 BEGIN
 -- Instantiate the Unit Under Test (UUT)
 uut: hadd PORT MAP(
 a => a,
 b => b,
 sum => sum,
 carry => carry
 );

 tb : PROCESS
 BEGIN
 a<='0'; b<='0'; wait for 100 ps;
 a<='0'; b<='1'; wait for 100 ps;
 a<='1'; b<='0'; wait for 100 ps;
 a<='1'; b<='1'; wait for 100 ps;

 END PROCESS;
 END;
FULL ADDER:
A B C SUM CARRY
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
LOGIC DIAGRAM: TRUTH TABLE:
 Dataflow Modeling:
 library IEEE;
 use IEEE.STD_LOGIC_1164.ALL;
 use IEEE.STD_LOGIC_ARITH.ALL;
 use IEEE.STD_LOGIC_UNSIGNED.ALL;
 entity fadd_dataflow is
 Port ( a : in std_logic;
 b : in std_logic;
 c : in std_logic;
 sum : out std_logic;
 carry : out std_logic);
 end fadd_dataflow;
 architecture dataflow of fadd_dataflow is
 signal p,q,r,s:std_logic;
 begin
 p<= a xor b;
 q<= a and b;
 r<= b and c;
 s<= c and a;
 sum<= p xor c;
 carry<= q or r or s;
 end dataflow;
 Behavioral Modeling:
 library IEEE;
 use IEEE.STD_LOGIC_1164.ALL;
 use IEEE.STD_LOGIC_ARITH.ALL;
 use IEEE.STD_LOGIC_UNSIGNED.ALL;
 entity fadd_behv is
 Port ( a : in std_logic;
 b : in std_logic;
 c : in std_logic;
 sum : out std_logic;
 carry : out std_logic);
 end fadd_behv;
 architecture Behavioral of fadd_behv is
 begin
 p1:process(a,b,c)
 variable r,s,t:std_logic;
 begin
 r:= a and b;
 s:= b and c;
 t:= c and a;
 sum<= a xor b xor c;
 carry<= r or s or t;
 end process p1;
 end Behavioral;
Structural Modeling:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity fadd_structural is
Port ( a : in std_logic;
b : in std_logic;
c : in std_logic;
sum : out std_logic;
carry : out std_logic);
end fadd_structural;
architecture structural of fadd_structural is
component xor2
port(a,b:in std_logic;
z:out std_logic);
end component;
component and2
port(a,b:in std_logic;
z:out std_logic);
end component;
component or3
port(a,b,c:in std_logic;
z:out std_logic);
end component;
signal p,q,r,s:std_logic;
begin
x1: xor2 port map (a,b,p);
x2: xor2 port map (p,c,sum);
a1: and2 port map (a,b,q);
a2: and2 port map (b,c,r);
a3: and2 port map (c,a,s);
o1: or3 port map (q,r,s,carry);
end structural;
and2 component source code:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity and2 is
Port ( a : in std_logic;
b : in std_logic;
z : out std_logic);
end and2;
architecture dataflow of and2 is
begin
z<= a and b;
end dataflow;
or3 component source code:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use
IEEE.STD_LOGIC_UNSIGNED.ALL;
entity or3 is
Port ( a : in std_logic;
b : in std_logic;
c : in std_logic;
z : out std_logic);
end or3;
architecture dataflow of or3 is
begin
z<= a or b or c;
end dataflow;
xor2 component source code:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity xor2 is
Port ( a : in std_logic;
b : in std_logic;
z : out std_logic);
end xor2;
architecture dataflow of xor2 is
begin
z<= a xor b;
end dataflow;

More Related Content

What's hot

What's hot (20)

Lecture2 vhdl refresher
Lecture2 vhdl refresherLecture2 vhdl refresher
Lecture2 vhdl refresher
 
Short.course.introduction.to.vhdl for beginners
Short.course.introduction.to.vhdl for beginners Short.course.introduction.to.vhdl for beginners
Short.course.introduction.to.vhdl for beginners
 
Introduction to VHDL
Introduction to VHDLIntroduction to VHDL
Introduction to VHDL
 
Basics of Vhdl
Basics of VhdlBasics of Vhdl
Basics of Vhdl
 
VHDL Part 4
VHDL Part 4VHDL Part 4
VHDL Part 4
 
VHDL Packages, Coding Styles for Arithmetic Operations and VHDL-200x Additions
VHDL Packages, Coding Styles for Arithmetic Operations and VHDL-200x AdditionsVHDL Packages, Coding Styles for Arithmetic Operations and VHDL-200x Additions
VHDL Packages, Coding Styles for Arithmetic Operations and VHDL-200x Additions
 
VHDL-Behavioral-Programs-Structure of VHDL
VHDL-Behavioral-Programs-Structure of VHDLVHDL-Behavioral-Programs-Structure of VHDL
VHDL-Behavioral-Programs-Structure of VHDL
 
VHDL course
VHDL courseVHDL course
VHDL course
 
VHDL - Part 2
VHDL - Part 2VHDL - Part 2
VHDL - Part 2
 
VHDL Entity
VHDL EntityVHDL Entity
VHDL Entity
 
Verilog HDL Training Course
Verilog HDL Training CourseVerilog HDL Training Course
Verilog HDL Training Course
 
VHDL CODES
VHDL CODES VHDL CODES
VHDL CODES
 
Vhdl programming
Vhdl programmingVhdl programming
Vhdl programming
 
Vhdl
VhdlVhdl
Vhdl
 
INTRODUCTION TO VHDL
INTRODUCTION    TO    VHDLINTRODUCTION    TO    VHDL
INTRODUCTION TO VHDL
 
Lecture3 combinational blocks
Lecture3 combinational blocksLecture3 combinational blocks
Lecture3 combinational blocks
 
VHDL - Enumerated Types (Part 3)
VHDL - Enumerated Types (Part 3)VHDL - Enumerated Types (Part 3)
VHDL - Enumerated Types (Part 3)
 
Vhdl 1
Vhdl 1Vhdl 1
Vhdl 1
 
Introduction to VHDL
Introduction to VHDLIntroduction to VHDL
Introduction to VHDL
 
Introduction to VHDL
Introduction to VHDLIntroduction to VHDL
Introduction to VHDL
 

Viewers also liked

4Sem VTU-HDL Programming Notes-Unit3-Behavioral Descriptions
4Sem VTU-HDL Programming Notes-Unit3-Behavioral Descriptions4Sem VTU-HDL Programming Notes-Unit3-Behavioral Descriptions
4Sem VTU-HDL Programming Notes-Unit3-Behavioral DescriptionsDr. Shivananda Koteshwar
 
Vhd lhigh2003
Vhd lhigh2003Vhd lhigh2003
Vhd lhigh2003gkumawat
 
Digital system design practical file
Digital system design practical fileDigital system design practical file
Digital system design practical fileArchita Misra
 
4Sem VTU-HDL Programming Notes-Unit2-Data Flow Descriptions
4Sem VTU-HDL Programming Notes-Unit2-Data Flow Descriptions4Sem VTU-HDL Programming Notes-Unit2-Data Flow Descriptions
4Sem VTU-HDL Programming Notes-Unit2-Data Flow DescriptionsDr. Shivananda Koteshwar
 
4Sem VTU-HDL Programming Notes-Unit1-Introduction
4Sem VTU-HDL Programming Notes-Unit1-Introduction4Sem VTU-HDL Programming Notes-Unit1-Introduction
4Sem VTU-HDL Programming Notes-Unit1-IntroductionDr. Shivananda Koteshwar
 
All VLSI programs
All VLSI programsAll VLSI programs
All VLSI programsGouthaman V
 
Hsc project management 2015
Hsc project management 2015Hsc project management 2015
Hsc project management 2015greg robertson
 
HSC Context and data flow diagrams ( DFD )
HSC Context and data flow diagrams ( DFD )HSC Context and data flow diagrams ( DFD )
HSC Context and data flow diagrams ( DFD )greg robertson
 

Viewers also liked (20)

4Sem VTU-HDL Programming Notes-Unit3-Behavioral Descriptions
4Sem VTU-HDL Programming Notes-Unit3-Behavioral Descriptions4Sem VTU-HDL Programming Notes-Unit3-Behavioral Descriptions
4Sem VTU-HDL Programming Notes-Unit3-Behavioral Descriptions
 
Behavioral modelling in VHDL
Behavioral modelling in VHDLBehavioral modelling in VHDL
Behavioral modelling in VHDL
 
Unit i
Unit  iUnit  i
Unit i
 
Vhd lhigh2003
Vhd lhigh2003Vhd lhigh2003
Vhd lhigh2003
 
VHDL Reference
VHDL ReferenceVHDL Reference
VHDL Reference
 
Digital system design practical file
Digital system design practical fileDigital system design practical file
Digital system design practical file
 
Dataflow Analysis
Dataflow AnalysisDataflow Analysis
Dataflow Analysis
 
Encoder decoder
Encoder decoderEncoder decoder
Encoder decoder
 
4Sem VTU-HDL Programming Notes-Unit2-Data Flow Descriptions
4Sem VTU-HDL Programming Notes-Unit2-Data Flow Descriptions4Sem VTU-HDL Programming Notes-Unit2-Data Flow Descriptions
4Sem VTU-HDL Programming Notes-Unit2-Data Flow Descriptions
 
Verilog tutorial
Verilog tutorialVerilog tutorial
Verilog tutorial
 
4Sem VTU-HDL Programming Notes-Unit1-Introduction
4Sem VTU-HDL Programming Notes-Unit1-Introduction4Sem VTU-HDL Programming Notes-Unit1-Introduction
4Sem VTU-HDL Programming Notes-Unit1-Introduction
 
Behavioral modeling
Behavioral modelingBehavioral modeling
Behavioral modeling
 
All VLSI programs
All VLSI programsAll VLSI programs
All VLSI programs
 
VERILOG CODE
VERILOG CODEVERILOG CODE
VERILOG CODE
 
Programs of VHDL
Programs of VHDLPrograms of VHDL
Programs of VHDL
 
Introduction to CAD/CAM
Introduction to CAD/CAMIntroduction to CAD/CAM
Introduction to CAD/CAM
 
Hsc project management 2015
Hsc project management 2015Hsc project management 2015
Hsc project management 2015
 
Introduction to cad cam
Introduction to cad camIntroduction to cad cam
Introduction to cad cam
 
HSC Context and data flow diagrams ( DFD )
HSC Context and data flow diagrams ( DFD )HSC Context and data flow diagrams ( DFD )
HSC Context and data flow diagrams ( DFD )
 
Multiplexers & Demultiplexers
Multiplexers & DemultiplexersMultiplexers & Demultiplexers
Multiplexers & Demultiplexers
 

Similar to Vhdl basic unit-2

Digital System Design Lab Report - VHDL ECE
Digital System Design Lab Report - VHDL ECEDigital System Design Lab Report - VHDL ECE
Digital System Design Lab Report - VHDL ECERamesh Naik Bhukya
 
Practical file
Practical filePractical file
Practical filerajeevkr35
 
learning vhdl by examples
learning vhdl by exampleslearning vhdl by examples
learning vhdl by examplesanishgoel
 
Digital system design lab manual
Digital system design lab manualDigital system design lab manual
Digital system design lab manualSanthosh Poralu
 
Learning vhdl by examples
Learning vhdl by examplesLearning vhdl by examples
Learning vhdl by examplesanishgoel
 
VHDL summer training (ppt)
 VHDL summer training (ppt) VHDL summer training (ppt)
VHDL summer training (ppt)HoneyKumar34
 
Session 02 _rtl_design_with_vhdl 101
Session 02 _rtl_design_with_vhdl 101Session 02 _rtl_design_with_vhdl 101
Session 02 _rtl_design_with_vhdl 101Mahmoud Abdellatif
 
VLSI Lab manual PDF
VLSI Lab manual PDFVLSI Lab manual PDF
VLSI Lab manual PDFUR11EC098
 
FPGA training session generic package and funtions of VHDL by Digitronix Nepal
FPGA training session generic package and funtions of VHDL by Digitronix NepalFPGA training session generic package and funtions of VHDL by Digitronix Nepal
FPGA training session generic package and funtions of VHDL by Digitronix NepalKrishna Gaihre
 
Digital Electronics .
Digital Electronics                                              .Digital Electronics                                              .
Digital Electronics .inian2
 
session 3a Hardware description language
session 3a Hardware description languagesession 3a Hardware description language
session 3a Hardware description languagedhananjeyanrece
 
vlsi design using verilog presentaion 1
vlsi design using verilog   presentaion 1vlsi design using verilog   presentaion 1
vlsi design using verilog presentaion 1MANDHASAIGOUD1
 

Similar to Vhdl basic unit-2 (20)

Presentation1.pdf
Presentation1.pdfPresentation1.pdf
Presentation1.pdf
 
Digital System Design Lab Report - VHDL ECE
Digital System Design Lab Report - VHDL ECEDigital System Design Lab Report - VHDL ECE
Digital System Design Lab Report - VHDL ECE
 
Practical file
Practical filePractical file
Practical file
 
learning vhdl by examples
learning vhdl by exampleslearning vhdl by examples
learning vhdl by examples
 
Digital system design lab manual
Digital system design lab manualDigital system design lab manual
Digital system design lab manual
 
VHDL Programs
VHDL ProgramsVHDL Programs
VHDL Programs
 
Learning vhdl by examples
Learning vhdl by examplesLearning vhdl by examples
Learning vhdl by examples
 
VHDL summer training (ppt)
 VHDL summer training (ppt) VHDL summer training (ppt)
VHDL summer training (ppt)
 
Session 02 _rtl_design_with_vhdl 101
Session 02 _rtl_design_with_vhdl 101Session 02 _rtl_design_with_vhdl 101
Session 02 _rtl_design_with_vhdl 101
 
VLSI Lab manual PDF
VLSI Lab manual PDFVLSI Lab manual PDF
VLSI Lab manual PDF
 
Verilogspk1
Verilogspk1Verilogspk1
Verilogspk1
 
Verilog HDL
Verilog HDLVerilog HDL
Verilog HDL
 
Dsd prac1
Dsd prac1Dsd prac1
Dsd prac1
 
Session1
Session1Session1
Session1
 
Vhdl new
Vhdl newVhdl new
Vhdl new
 
FPGA training session generic package and funtions of VHDL by Digitronix Nepal
FPGA training session generic package and funtions of VHDL by Digitronix NepalFPGA training session generic package and funtions of VHDL by Digitronix Nepal
FPGA training session generic package and funtions of VHDL by Digitronix Nepal
 
Dica ii chapter slides
Dica ii chapter slidesDica ii chapter slides
Dica ii chapter slides
 
Digital Electronics .
Digital Electronics                                              .Digital Electronics                                              .
Digital Electronics .
 
session 3a Hardware description language
session 3a Hardware description languagesession 3a Hardware description language
session 3a Hardware description language
 
vlsi design using verilog presentaion 1
vlsi design using verilog   presentaion 1vlsi design using verilog   presentaion 1
vlsi design using verilog presentaion 1
 

Recently uploaded

Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 

Recently uploaded (20)

Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 

Vhdl basic unit-2

  • 1. VHDL  V-VHSIC- VERY HIGH SPEED INTERGRATED CIRCUIT  HDL- HARD WARE DISCRIPTION LANGUAGE *VHDL AND VERILOG HDL FOR DEVELOPMENT AND DESIGN SYSTEM VERILOG FOR VERIFICATION It can be model a digital system at many level of abstraction ranging from algorithmic level to gate level
  • 2. History of VHDL  IT WAS FIRST GENRATION 1981  THREE COMPANIES IBM,TEXAS INS. AND INTERMETRICS.  DEVELOPED VERSION 7.2 OF VHDL – 1985
  • 3. COMPARSIONOF VHDL AND VERILOG VHDL VERILOG HDL Depends on library function It is independent of library Body consisted of two parts Entire body defined as module Case insensitivity ( upper and lower case) Case insensitivity Library need for vhdl Library not need It is free language Structural language
  • 4. Different b/w Verilog and vhdl Fuction Vhdl verilog AND GATE AND & OR GATE OR ! NAND NAND ~ & NOR NOR ~ ! XOR XOR ^ XNOR XNOR ~^ NOT NOT ~
  • 5.  Vhdl provides 5 different type of primary constructs called design units.  Entity declaration  Configuration declaration  Architecture body  Package declaration  Package body
  • 6. HARDWARE ABSTRACT DEVICE DEVICE DEVICE MODELmodel Digital systems External view Internal view
  • 8. MODELS IN VHDL  STRUCTURAL MODEL  DATAFLOW MODEL  BEHAVIERAL MODEL  HYBRID MODEL  PHYSICAL MODEL
  • 9. STRUCTURE OF VHDL PROGRAM  Library declaration  Entity  Architecture body
  • 10. BASIC STRUCTURE OF VHDL PROGRAM  library IEEE;  use IEEE.STD_LOGIC_1164.ALL;  use IEEE.STD_LOGIC_ARITH.ALL;  use IEEE.STD_LOGIC_UNSIGNED.ALL;  Entity entity name is  Port declaration; in type ;( data type)  port declaration ; out type;  End entity name;  Architecture Arc name of entity name is  Signal declaration;  variable declaration;  Constant declaration;  Package declaration;  Component declaration;  Begin  Statement port  .  End Arc name;
  • 11. Half adder A B SUM CARRY 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 HALF ADDER: LOGIC DIAGRAM: TRUTH TABLE:
  • 12. Dataflow Modeling: for half adder   library IEEE;  use IEEE.STD_LOGIC_1164.ALL;  use IEEE.STD_LOGIC_ARITH.ALL;  use IEEE.STD_LOGIC_UNSIGNED.ALL;  entity hadd is  Port ( a : in std_logic;  b : in std_logic;  sum : out std_logic;  carry : out std_logic);  end hadd;  architecture dataflow of hadd is  begin  sum <= a xor b;  carry <= a and b;  end dataflow;
  • 13. Behavioral modeling for half adder Behavioral Modeling: library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity haddbehavioral is Port ( a : in std_logic; b : in std_logic; sum : out std_logic; carry : out std_logic); end haddbehavioral; architecture Behavioral of haddbehavioral is begin p1:process (a,b) begin sum<= a xor b; carry<= a and b; end process p1; end Behavioral;
  • 14. Structural Modeling: library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity haddstructural is Port ( a : in std_logic; b : in std_logic; sum : out std_logic; carry : out std_logic); end haddstructural; architecture structural of haddstructural is component xor2 port(a,b:in std_logic; z:out std_logic); end component; component and2 port(a,b:in std_logic; z:out std_logic); end component; begin x1: xor2 port map (a,b,sum); a1: and2 port map (a,b,carry); end structural; and2 component source code: library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity and2 is Port ( a : in std_logic; b : in std_logic; z : out std_logic); end and2; architecture dataflow of and2 is begin z<= a and b; end dataflow; xor2 component source code: library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity xor2 is Port ( a : in std_logic; b : in std_logic; z : out std_logic); end xor2; architecture dataflow of xor2 is begin z<= a xor b; end dataflow;
  • 15. Dataflow Modeling: half adder Behavioral Modeling: half adder Structural Modeling: half adder module ha_dataflow(a, b, s, ca); input a; input b; output s; output ca; assign#2 s=a^b; assign#2 ca=a&b; endmodule module ha_behv(a, b, s, ca); input a; input b; output s; output ca; reg s,ca; always @ (a or b) begin s=a^b; ca=a&b; end endmodule module ha_struct(a, b, s, ca); input a; input b; output s; output ca; xor x1(s,a,b); and a1(ca,a,b); endmodule VERILOG SOURCE CODE:
  • 16. Gate code for verilog  VERILOG SOURCE CODE:   module logicgates1(a, b, c);  input a;  input b;  OUTPUT: [6:0] c;  assign c[0]= a & b;  assign c[1]= a | b;  assign c[2]= ~(a & b);  assign c[3]= ~(a | b);  assign c[4]= a ^ b;  assign c[5]= ~(a ^ b);  assign c[6]= ~ a;  endmodule
  • 17. TEST BENCH(VHDL):  LIBRARY ieee;  USE ieee.std_logic_1164.ALL;  USE ieee.std_logic_unsigned.all;  USE ieee.numeric_std.ALL;  ENTITY test_bench_vhd IS  END test_bench_vhd;  ARCHITECTURE behavior OF test_bench_vhd IS
  • 18.  COMPONENT hadd  PORT(  a : IN std_logic;  b : IN std_logic;  sum : OUT std_logic;  carry : OUT std_logic  );  END COMPONENT;   --Inputs  SIGNAL a : std_logic := '0';  SIGNAL b : std_logic := '0';   --Outputs  SIGNAL sum : std_logic;  SIGNAL carry : std_logic; 
  • 19.  BEGIN  -- Instantiate the Unit Under Test (UUT)  uut: hadd PORT MAP(  a => a,  b => b,  sum => sum,  carry => carry  );   tb : PROCESS  BEGIN  a<='0'; b<='0'; wait for 100 ps;  a<='0'; b<='1'; wait for 100 ps;  a<='1'; b<='0'; wait for 100 ps;  a<='1'; b<='1'; wait for 100 ps;   END PROCESS;  END;
  • 20. FULL ADDER: A B C SUM CARRY 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1 LOGIC DIAGRAM: TRUTH TABLE:
  • 21.  Dataflow Modeling:  library IEEE;  use IEEE.STD_LOGIC_1164.ALL;  use IEEE.STD_LOGIC_ARITH.ALL;  use IEEE.STD_LOGIC_UNSIGNED.ALL;  entity fadd_dataflow is  Port ( a : in std_logic;  b : in std_logic;  c : in std_logic;  sum : out std_logic;  carry : out std_logic);  end fadd_dataflow;  architecture dataflow of fadd_dataflow is  signal p,q,r,s:std_logic;  begin  p<= a xor b;  q<= a and b;  r<= b and c;  s<= c and a;  sum<= p xor c;  carry<= q or r or s;  end dataflow;
  • 22.  Behavioral Modeling:  library IEEE;  use IEEE.STD_LOGIC_1164.ALL;  use IEEE.STD_LOGIC_ARITH.ALL;  use IEEE.STD_LOGIC_UNSIGNED.ALL;  entity fadd_behv is  Port ( a : in std_logic;  b : in std_logic;  c : in std_logic;  sum : out std_logic;  carry : out std_logic);  end fadd_behv;  architecture Behavioral of fadd_behv is  begin  p1:process(a,b,c)  variable r,s,t:std_logic;  begin  r:= a and b;  s:= b and c;  t:= c and a;  sum<= a xor b xor c;  carry<= r or s or t;  end process p1;  end Behavioral;
  • 23. Structural Modeling: library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity fadd_structural is Port ( a : in std_logic; b : in std_logic; c : in std_logic; sum : out std_logic; carry : out std_logic); end fadd_structural; architecture structural of fadd_structural is component xor2 port(a,b:in std_logic; z:out std_logic); end component; component and2 port(a,b:in std_logic; z:out std_logic); end component; component or3 port(a,b,c:in std_logic; z:out std_logic); end component; signal p,q,r,s:std_logic; begin x1: xor2 port map (a,b,p); x2: xor2 port map (p,c,sum); a1: and2 port map (a,b,q); a2: and2 port map (b,c,r); a3: and2 port map (c,a,s); o1: or3 port map (q,r,s,carry); end structural;
  • 24. and2 component source code: library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity and2 is Port ( a : in std_logic; b : in std_logic; z : out std_logic); end and2; architecture dataflow of and2 is begin z<= a and b; end dataflow; or3 component source code: library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity or3 is Port ( a : in std_logic; b : in std_logic; c : in std_logic; z : out std_logic); end or3; architecture dataflow of or3 is begin z<= a or b or c; end dataflow; xor2 component source code: library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity xor2 is Port ( a : in std_logic; b : in std_logic; z : out std_logic); end xor2; architecture dataflow of xor2 is begin z<= a xor b; end dataflow;