SlideShare a Scribd company logo
EXPERIMENT-1
Aim : Write a VHDL program to implement a multiplexer.
(i) 4:1 Multiplexer :
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity mux4to1 is
Port ( s : in STD_LOGIC_VECTOR (1 downto 0);
a : in STD_LOGIC_VECTOR (3 downto 0);
z : out STD_LOGIC);
end mux4to1;
architecture Behavioral of mux4to1 is
begin
process(s,a)
begin
if(s="00") then
z<= a(0);
elsif(s="01") then
z<= a(1);
elsif(s="10") then
z<= a(2);
else
z<= a(3);
end if;
end process;
end Behavioral;
OUTPUT :
(ii) 8:1 Multiplexer :
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity mux8to1 is
Port ( s : in STD_LOGIC_VECTOR (2 downto 0);
a : in STD_LOGIC_VECTOR (7 downto 0);
z : out STD_LOGIC);
end mux8to1;
architecture Behavioral of mux8to1 is
begin
process(s,a)
begin
if(s="000") then
z<= a(0);
elsif(s="001") then
z<= a(1);
elsif(s="010") then
z<= a(2);
elsif(s="011") then
z<= a(3);
elsif(s="100") then
z<= a(4);
elsif(s="101") then
z<= a(5);
elsif(s="110") then
z<= a(6);
else
z<= a(7);
end if;
end process;
end Behavioral;
OUTPUT :
EXPERIMENT-2
Aim : Write a VHDL program to implement a demultiplexer.
(i) 1:4 Demultiplexer :
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity demux1to4 is
Port ( s : in STD_LOGIC_VECTOR (1 downto 0);
i : in STD_LOGIC;
a : out STD_LOGIC_VECTOR (3 downto 0));
end demux1to4;
architecture Behavioral of demux1to4 is
begin
process(i,s)
begin
if(i='1') then
if(s="00") then
a<= "0001";
elsif(s="01") then
a<= "0010";
elsif(s="10") then
a<= "0100";
elsif(s="11") then
a<= "1000";
end if;
else
a<= "0000";
end if;
end process;
end Behavioral;
OUTPUT :
(ii) 1:8 Demultiplexer :
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity demux1to8 is
Port ( s : in STD_LOGIC_VECTOR (2 downto 0);
i : in STD_LOGIC;
a : out STD_LOGIC_VECTOR (7 downto 0));
end demux1to8;
architecture Behavioral of demux1to8 is
begin
process(i,s)
begin
if(i='1') then
if(s="000") then
a<= "00000001";
elsif(s="001") then
a<= "00000010";
elsif(s="010") then
a<= "00000100";
elsif(s="011") then
a<= "00001000";
elsif(s="100") then
a<= "00010000";
elsif(s="101") then
a<= "00100000";
elsif(s="110") then
a<= "01000000";
elsif(s="111") then
a<= "10000000";
end if;
else
a<= "00000000";
end if;
end process;
end Behavioral;
OUTPUT :
EXPERIMENT-3
Aim : Write a VHDL program to implement a 3:8 decoder.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity decoder3to8 is
Port ( i : in STD_LOGIC_VECTOR (2 downto 0);
en : in STD_LOGIC;
a : out STD_LOGIC_VECTOR (7 downto 0));
end decoder3to8;
architecture Behavioral of decoder3to8 is
begin
process(i,en)
begin
if(en='1') then
if(i="000") then
a<= "00000001";
elsif(i="001") then
a<= "00000010";
elsif(i="010") then
a<= "00000100";
elsif(i="011") then
a<= "00001000";
elsif(i="100") then
a<= "00010000";
elsif(i="101") then
a<= "00100000";
elsif(i="110") then
a<= "01000000";
elsif(i="111") then
a<= "10000000";
end if;
else
a<= "00000000";
end if;
end process;
end Behavioral;
OUTPUT :
EXPERIMENT-4
Aim: Write a VHDL program to implement a 4 bit adder.
--program for 1 bit full adder.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity fa is
Port ( x : in STD_LOGIC;
y : in STD_LOGIC;
c : in STD_LOGIC;
s : out STD_LOGIC;
co : out STD_LOGIC);
end fa;
architecture Behavioral of fa is
begin
s<= x xor y xor c;
co<= (x and y)or(y and c)or(c and x);
end Behavioral;
--program for 4 bit full adder.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity fa_4bit is
Port ( a : in STD_LOGIC_VECTOR (3 downto 0);
b : in STD_LOGIC_VECTOR (3 downto 0);
cin : in STD_LOGIC;
sum : out STD_LOGIC_VECTOR (3 downto 0);
cout : out STD_LOGIC);
end fa_4bit;
architecture Structural of fa_4bit is
signal cs : std_logic_vector (2 downto 0);
component fa
port (x : in STD_LOGIC;
y : in STD_LOGIC;
c : in STD_LOGIC;
s : out STD_LOGIC;
co : out STD_LOGIC);
end component;
begin
f1 : fa port map(a(0),b(0),cin,sum(0),cs(0));
f2 : fa port map(a(1),b(1),cs(0),sum(1),cs(1));
f3 : fa port map(a(2),b(2),cs(1),sum(2),cs(2));
f4 : fa port map(a(3),b(3),cs(2),sum(3),cout);
end Structural;
OUTPUT :
EXPERIMENT-5
Aim: Write a VHDL program to implement a 4 bit comparator.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity comprator_4bit is
Port ( a : in STD_LOGIC_VECTOR (3 downto 0);
b : in STD_LOGIC_VECTOR (3 downto 0);
less : out STD_LOGIC;
equal : out STD_LOGIC;
greater : out STD_LOGIC);
end comprator_4bit;
architecture Behavioral of comprator_4bit is
begin
process(a,b)
begin
if (a>b) then
greater <= '1';
equal <= '0';
less <= '0';
elsif (a<b) then
greater <= '0';
equal <= '0';
less <= '1';
else
greater <= '0';
equal <= '1';
less <= '0';
end if;
end process;
end Behavioral;
OUTPUT :
EXPERIMENT-6
Aim: Write a VHDL program to design a 2 bit ALU containing 4
arithmetic and 4 logical operations.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity alu_2bit is
Port ( a : in STD_LOGIC_VECTOR (1 downto 0);
b : in STD_LOGIC_VECTOR (1 downto 0);
sel : in STD_LOGIC_VECTOR (2 downto 0);
cin : in STD_LOGIC;
y : out STD_LOGIC_VECTOR (1 downto 0));
end alu_2bit;
architecture Behavioral of alu_2bit is
signal arith,logic : STD_LOGIC_VECTOR (1 downto 0);
begin
with sel(1 downto 0) select
arith <= a + 1 when "00",
a + b + cin when "01",
a - b when "10",
b + 1 when others;
with sel(1 downto 0) select
logic <= not a when "00",
a and b when "01",
a or b when "10",
a xor b when others;
with sel(2) select
y <= arith when '0',
logic when others;
end Behavioral;
OUTPUT :
EXPERIMENT-7
Aim: Write a VHDL program to design a D Flip Flop.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity dff is
Port ( d,clk, reset: in std_logic;
q : out std_logic);
end dff;
architecture Behavioral of dff is
begin
process (clk, d)
begin
if ( (d'event or clk'event) and clk='1') then
if RESET ='1' then
q <= '0' ;
else
q <= d after 1 us;
end if;
end if;
end process;
end Behavioral;
OUTPUT :
EXPERIMENT-8
Aim: Write a VHDL program to design a D Flip Flop.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity dff is
Port ( d,clk, reset: in std_logic;
q : out std_logic);
end dff;
architecture Behavioral of dff is
begin
process (clk, d)
begin
if ( (d'event or clk'event) and clk='1') then
if RESET ='1' then
q <= '0' ;
else
q <= d after 1 us;
end if;
end if;
end process;
end Behavioral;
OUTPUT :

More Related Content

What's hot

Verilog code for decoder
Verilog code for decoderVerilog code for decoder
Verilog code for decoder
Rakesh kumar jha
 
Day2 Verilog HDL Basic
Day2 Verilog HDL BasicDay2 Verilog HDL Basic
Day2 Verilog HDL BasicRon Liu
 
Switch level modeling
Switch level modelingSwitch level modeling
Switch level modeling
Devi Pradeep Podugu
 
VHDL Part 4
VHDL Part 4VHDL Part 4
VHDL Part 4
Abhilash Nair
 
VLSI Design Final Project - 32 bit ALU
VLSI Design Final Project - 32 bit ALUVLSI Design Final Project - 32 bit ALU
VLSI Design Final Project - 32 bit ALU
Sachin Kumar Asokan
 
Four way traffic light conrol using Verilog
Four way traffic light conrol using VerilogFour way traffic light conrol using Verilog
Four way traffic light conrol using Verilog
Utkarsh De
 
Radix 4 booth
Radix 4 boothRadix 4 booth
Radix 4 booth
Richu Jose Cyriac
 
VLSI & E-CAD Lab Manual
VLSI & E-CAD Lab ManualVLSI & E-CAD Lab Manual
VLSI & E-CAD Lab Manual
Amairullah Khan Lodhi
 
VHDL PROGRAMS FEW EXAMPLES
VHDL PROGRAMS FEW EXAMPLESVHDL PROGRAMS FEW EXAMPLES
VHDL PROGRAMS FEW EXAMPLES
karthik kadava
 
OPERATING OVERLOADING IN VHDL
OPERATING OVERLOADING IN VHDLOPERATING OVERLOADING IN VHDL
OPERATING OVERLOADING IN VHDL
BLESSYDAISE PAUL
 
VLSI Lab manual PDF
VLSI Lab manual PDFVLSI Lab manual PDF
VLSI Lab manual PDF
UR11EC098
 
Verilog coding of demux 8 x1
Verilog coding of demux  8 x1Verilog coding of demux  8 x1
Verilog coding of demux 8 x1
Rakesh kumar jha
 
Verilog Test Bench
Verilog Test BenchVerilog Test Bench
Verilog Test Bench
Dr.YNM
 
Verilog HDL
Verilog HDLVerilog HDL
Verilog HDL
Mantra VLSI
 
verilog code for logic gates
verilog code for logic gatesverilog code for logic gates
verilog code for logic gates
Rakesh kumar jha
 
CPLD xc9500
CPLD xc9500CPLD xc9500
CPLD xc9500
A B Shinde
 
VHDL Subprograms and Packages
VHDL Subprograms and PackagesVHDL Subprograms and Packages
VHDL Subprograms and Packages
Ramasubbu .P
 
structural modeling, hazards
structural modeling, hazardsstructural modeling, hazards
structural modeling, hazards
dennis gookyi
 

What's hot (20)

Verilog code for decoder
Verilog code for decoderVerilog code for decoder
Verilog code for decoder
 
Day2 Verilog HDL Basic
Day2 Verilog HDL BasicDay2 Verilog HDL Basic
Day2 Verilog HDL Basic
 
Switch level modeling
Switch level modelingSwitch level modeling
Switch level modeling
 
VHDL Part 4
VHDL Part 4VHDL Part 4
VHDL Part 4
 
VLSI Design Final Project - 32 bit ALU
VLSI Design Final Project - 32 bit ALUVLSI Design Final Project - 32 bit ALU
VLSI Design Final Project - 32 bit ALU
 
Data Flow Modeling
Data Flow ModelingData Flow Modeling
Data Flow Modeling
 
4 bit uni shift reg
4 bit uni shift reg4 bit uni shift reg
4 bit uni shift reg
 
Four way traffic light conrol using Verilog
Four way traffic light conrol using VerilogFour way traffic light conrol using Verilog
Four way traffic light conrol using Verilog
 
Radix 4 booth
Radix 4 boothRadix 4 booth
Radix 4 booth
 
VLSI & E-CAD Lab Manual
VLSI & E-CAD Lab ManualVLSI & E-CAD Lab Manual
VLSI & E-CAD Lab Manual
 
VHDL PROGRAMS FEW EXAMPLES
VHDL PROGRAMS FEW EXAMPLESVHDL PROGRAMS FEW EXAMPLES
VHDL PROGRAMS FEW EXAMPLES
 
OPERATING OVERLOADING IN VHDL
OPERATING OVERLOADING IN VHDLOPERATING OVERLOADING IN VHDL
OPERATING OVERLOADING IN VHDL
 
VLSI Lab manual PDF
VLSI Lab manual PDFVLSI Lab manual PDF
VLSI Lab manual PDF
 
Verilog coding of demux 8 x1
Verilog coding of demux  8 x1Verilog coding of demux  8 x1
Verilog coding of demux 8 x1
 
Verilog Test Bench
Verilog Test BenchVerilog Test Bench
Verilog Test Bench
 
Verilog HDL
Verilog HDLVerilog HDL
Verilog HDL
 
verilog code for logic gates
verilog code for logic gatesverilog code for logic gates
verilog code for logic gates
 
CPLD xc9500
CPLD xc9500CPLD xc9500
CPLD xc9500
 
VHDL Subprograms and Packages
VHDL Subprograms and PackagesVHDL Subprograms and Packages
VHDL Subprograms and Packages
 
structural modeling, hazards
structural modeling, hazardsstructural modeling, hazards
structural modeling, hazards
 

Viewers also liked

Katelyn Jennings Personal Resume
Katelyn Jennings Personal ResumeKatelyn Jennings Personal Resume
Katelyn Jennings Personal Resume
Katelyn Jennings
 
Ramirez ventura
Ramirez venturaRamirez ventura
Ramirez ventura
JhonatanRamirez97
 
Lauren Buchholz BIS Tech Talk
Lauren Buchholz BIS Tech TalkLauren Buchholz BIS Tech Talk
Lauren Buchholz BIS Tech Talk
Lauren Buchholz
 
Katelyn Jennings Virtual Resume
Katelyn Jennings Virtual ResumeKatelyn Jennings Virtual Resume
Katelyn Jennings Virtual Resume
Katelyn Jennings
 
Caja automatica en español
Caja automatica  en españolCaja automatica  en español
Caja automatica en españolWilly Nina
 
The verb time
The verb timeThe verb time
The verb time
JhonatanRamirez97
 
Spring Staff Retreat 2015
Spring Staff Retreat 2015Spring Staff Retreat 2015
Spring Staff Retreat 2015
uscsowk
 
Compare!
Compare!Compare!
Compare!
pedroruzm
 
Financial Crisis Informative Speech
Financial Crisis Informative SpeechFinancial Crisis Informative Speech
Financial Crisis Informative Speech
Lauren Buchholz
 
Katelyn Jennings Resume
Katelyn Jennings ResumeKatelyn Jennings Resume
Katelyn Jennings Resume
Katelyn Jennings
 
Food piramid
Food piramidFood piramid
Food piramid
joelpicazo
 
Practice english
Practice englishPractice english
Practice english
JhonatanRamirez97
 
The role of gingipains in the pathogenesis of periodontal diseases
The role of gingipains in the pathogenesis of periodontal diseasesThe role of gingipains in the pathogenesis of periodontal diseases
The role of gingipains in the pathogenesis of periodontal diseases
Ankita Jain
 
Bases Moleculares de la Nefrotoxicidad Inducida por Farmacos
Bases Moleculares de la Nefrotoxicidad Inducida por FarmacosBases Moleculares de la Nefrotoxicidad Inducida por Farmacos
Bases Moleculares de la Nefrotoxicidad Inducida por Farmacos
Julio Albarran
 
Dsp lab manual
Dsp lab manualDsp lab manual
Dsp lab manual
Mukul Mohal
 
The Netherland 2014
The Netherland 2014The Netherland 2014
The Netherland 2014
syzwnrhms
 
Project report on dtmf based door opening system
Project report on  dtmf based door opening systemProject report on  dtmf based door opening system
Project report on dtmf based door opening system
Mukul Mohal
 
Surgical anatomy of periodontal structures,
Surgical anatomy of periodontal structures,Surgical anatomy of periodontal structures,
Surgical anatomy of periodontal structures,
Ankita Jain
 

Viewers also liked (20)

Katelyn Jennings Personal Resume
Katelyn Jennings Personal ResumeKatelyn Jennings Personal Resume
Katelyn Jennings Personal Resume
 
Ramirez ventura
Ramirez venturaRamirez ventura
Ramirez ventura
 
Lauren Buchholz BIS Tech Talk
Lauren Buchholz BIS Tech TalkLauren Buchholz BIS Tech Talk
Lauren Buchholz BIS Tech Talk
 
Katelyn Jennings Virtual Resume
Katelyn Jennings Virtual ResumeKatelyn Jennings Virtual Resume
Katelyn Jennings Virtual Resume
 
Caja automatica en español
Caja automatica  en españolCaja automatica  en español
Caja automatica en español
 
Lauren Buchholz T
Lauren Buchholz TLauren Buchholz T
Lauren Buchholz T
 
The verb time
The verb timeThe verb time
The verb time
 
Spring Staff Retreat 2015
Spring Staff Retreat 2015Spring Staff Retreat 2015
Spring Staff Retreat 2015
 
NEUMATON
NEUMATONNEUMATON
NEUMATON
 
Compare!
Compare!Compare!
Compare!
 
Financial Crisis Informative Speech
Financial Crisis Informative SpeechFinancial Crisis Informative Speech
Financial Crisis Informative Speech
 
Katelyn Jennings Resume
Katelyn Jennings ResumeKatelyn Jennings Resume
Katelyn Jennings Resume
 
Food piramid
Food piramidFood piramid
Food piramid
 
Practice english
Practice englishPractice english
Practice english
 
The role of gingipains in the pathogenesis of periodontal diseases
The role of gingipains in the pathogenesis of periodontal diseasesThe role of gingipains in the pathogenesis of periodontal diseases
The role of gingipains in the pathogenesis of periodontal diseases
 
Bases Moleculares de la Nefrotoxicidad Inducida por Farmacos
Bases Moleculares de la Nefrotoxicidad Inducida por FarmacosBases Moleculares de la Nefrotoxicidad Inducida por Farmacos
Bases Moleculares de la Nefrotoxicidad Inducida por Farmacos
 
Dsp lab manual
Dsp lab manualDsp lab manual
Dsp lab manual
 
The Netherland 2014
The Netherland 2014The Netherland 2014
The Netherland 2014
 
Project report on dtmf based door opening system
Project report on  dtmf based door opening systemProject report on  dtmf based door opening system
Project report on dtmf based door opening system
 
Surgical anatomy of periodontal structures,
Surgical anatomy of periodontal structures,Surgical anatomy of periodontal structures,
Surgical anatomy of periodontal structures,
 

Similar to Vhdl lab manual

Programs of VHDL
Programs of VHDLPrograms of VHDL
Programs of VHDL
Rkrishna Mishra
 
correctionTD-1-vhdl2947.pptx
correctionTD-1-vhdl2947.pptxcorrectionTD-1-vhdl2947.pptx
correctionTD-1-vhdl2947.pptx
MbarkiIsraa
 
vhdll.docx
vhdll.docxvhdll.docx
vhdll.docx
NguynTinDng35
 
Vhdl programming
Vhdl programmingVhdl programming
Vhdl programming
Yogesh Mashalkar
 
correctionTD-2-vhdl2949.pptx
correctionTD-2-vhdl2949.pptxcorrectionTD-2-vhdl2949.pptx
correctionTD-2-vhdl2949.pptx
MbarkiIsraa
 
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
Ramesh Naik Bhukya
 
Basic-VHDL-Constructs1.ppt
Basic-VHDL-Constructs1.pptBasic-VHDL-Constructs1.ppt
Basic-VHDL-Constructs1.ppt
BUCHUPALLIVIMALAREDD2
 
Digital to analog -Sqaure waveform generator in VHDL
Digital to analog -Sqaure waveform generator in VHDLDigital to analog -Sqaure waveform generator in VHDL
Digital to analog -Sqaure waveform generator in VHDL
Omkar Rane
 
Vhdl
VhdlVhdl
Digital system design lab manual
Digital system design lab manualDigital system design lab manual
Digital system design lab manual
Santhosh Poralu
 
Reporte vhdl9
Reporte vhdl9Reporte vhdl9
Reporte vhdl9
Miguel Angel Peña
 
Verilogforlab
VerilogforlabVerilogforlab
Verilogforlab
Shankar Bhukya
 
Vhdl
VhdlVhdl
hdl timer ppt.pptx
hdl timer ppt.pptxhdl timer ppt.pptx
hdl timer ppt.pptx
ChethaSp
 
Reporte vhd10
Reporte vhd10Reporte vhd10
Reporte vhd10
Miguel Angel Peña
 
Arithmatic logic unit using VHDL (gates)
Arithmatic logic unit using VHDL (gates)Arithmatic logic unit using VHDL (gates)
Arithmatic logic unit using VHDL (gates)
TakashiSuoh
 
Practical file
Practical filePractical file
Practical file
rajeevkr35
 

Similar to Vhdl lab manual (20)

Vhdlbputspdas
VhdlbputspdasVhdlbputspdas
Vhdlbputspdas
 
Programs of VHDL
Programs of VHDLPrograms of VHDL
Programs of VHDL
 
correctionTD-1-vhdl2947.pptx
correctionTD-1-vhdl2947.pptxcorrectionTD-1-vhdl2947.pptx
correctionTD-1-vhdl2947.pptx
 
vhdll.docx
vhdll.docxvhdll.docx
vhdll.docx
 
Vhdl programming
Vhdl programmingVhdl programming
Vhdl programming
 
correctionTD-2-vhdl2949.pptx
correctionTD-2-vhdl2949.pptxcorrectionTD-2-vhdl2949.pptx
correctionTD-2-vhdl2949.pptx
 
Vhdl
VhdlVhdl
Vhdl
 
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
 
Basic-VHDL-Constructs1.ppt
Basic-VHDL-Constructs1.pptBasic-VHDL-Constructs1.ppt
Basic-VHDL-Constructs1.ppt
 
Digital to analog -Sqaure waveform generator in VHDL
Digital to analog -Sqaure waveform generator in VHDLDigital to analog -Sqaure waveform generator in VHDL
Digital to analog -Sqaure waveform generator in VHDL
 
Vhdl
VhdlVhdl
Vhdl
 
Digital system design lab manual
Digital system design lab manualDigital system design lab manual
Digital system design lab manual
 
Reporte vhdl9
Reporte vhdl9Reporte vhdl9
Reporte vhdl9
 
Verilogforlab
VerilogforlabVerilogforlab
Verilogforlab
 
Vhdl
VhdlVhdl
Vhdl
 
Fpga creating counter with internal clock
Fpga   creating counter with internal clockFpga   creating counter with internal clock
Fpga creating counter with internal clock
 
hdl timer ppt.pptx
hdl timer ppt.pptxhdl timer ppt.pptx
hdl timer ppt.pptx
 
Reporte vhd10
Reporte vhd10Reporte vhd10
Reporte vhd10
 
Arithmatic logic unit using VHDL (gates)
Arithmatic logic unit using VHDL (gates)Arithmatic logic unit using VHDL (gates)
Arithmatic logic unit using VHDL (gates)
 
Practical file
Practical filePractical file
Practical file
 

Recently uploaded

The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
AafreenAbuthahir2
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
SupreethSP4
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
FluxPrime1
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 

Recently uploaded (20)

The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 

Vhdl lab manual

  • 1. EXPERIMENT-1 Aim : Write a VHDL program to implement a multiplexer. (i) 4:1 Multiplexer : library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity mux4to1 is Port ( s : in STD_LOGIC_VECTOR (1 downto 0); a : in STD_LOGIC_VECTOR (3 downto 0); z : out STD_LOGIC); end mux4to1; architecture Behavioral of mux4to1 is begin process(s,a) begin if(s="00") then z<= a(0); elsif(s="01") then z<= a(1); elsif(s="10") then z<= a(2);
  • 2. else z<= a(3); end if; end process; end Behavioral; OUTPUT :
  • 3. (ii) 8:1 Multiplexer : library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity mux8to1 is Port ( s : in STD_LOGIC_VECTOR (2 downto 0); a : in STD_LOGIC_VECTOR (7 downto 0); z : out STD_LOGIC); end mux8to1; architecture Behavioral of mux8to1 is begin process(s,a) begin if(s="000") then z<= a(0); elsif(s="001") then z<= a(1); elsif(s="010") then z<= a(2); elsif(s="011") then z<= a(3); elsif(s="100") then
  • 4. z<= a(4); elsif(s="101") then z<= a(5); elsif(s="110") then z<= a(6); else z<= a(7); end if; end process; end Behavioral; OUTPUT :
  • 5. EXPERIMENT-2 Aim : Write a VHDL program to implement a demultiplexer. (i) 1:4 Demultiplexer : library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity demux1to4 is Port ( s : in STD_LOGIC_VECTOR (1 downto 0); i : in STD_LOGIC; a : out STD_LOGIC_VECTOR (3 downto 0)); end demux1to4; architecture Behavioral of demux1to4 is begin process(i,s) begin if(i='1') then if(s="00") then a<= "0001"; elsif(s="01") then a<= "0010"; elsif(s="10") then
  • 6. a<= "0100"; elsif(s="11") then a<= "1000"; end if; else a<= "0000"; end if; end process; end Behavioral; OUTPUT :
  • 7. (ii) 1:8 Demultiplexer : library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity demux1to8 is Port ( s : in STD_LOGIC_VECTOR (2 downto 0); i : in STD_LOGIC; a : out STD_LOGIC_VECTOR (7 downto 0)); end demux1to8; architecture Behavioral of demux1to8 is begin process(i,s) begin if(i='1') then if(s="000") then a<= "00000001"; elsif(s="001") then a<= "00000010"; elsif(s="010") then a<= "00000100"; elsif(s="011") then a<= "00001000";
  • 8. elsif(s="100") then a<= "00010000"; elsif(s="101") then a<= "00100000"; elsif(s="110") then a<= "01000000"; elsif(s="111") then a<= "10000000"; end if; else a<= "00000000"; end if; end process; end Behavioral; OUTPUT :
  • 9. EXPERIMENT-3 Aim : Write a VHDL program to implement a 3:8 decoder. library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity decoder3to8 is Port ( i : in STD_LOGIC_VECTOR (2 downto 0); en : in STD_LOGIC; a : out STD_LOGIC_VECTOR (7 downto 0)); end decoder3to8; architecture Behavioral of decoder3to8 is begin process(i,en) begin if(en='1') then if(i="000") then a<= "00000001"; elsif(i="001") then a<= "00000010"; elsif(i="010") then a<= "00000100"; elsif(i="011") then a<= "00001000";
  • 10. elsif(i="100") then a<= "00010000"; elsif(i="101") then a<= "00100000"; elsif(i="110") then a<= "01000000"; elsif(i="111") then a<= "10000000"; end if; else a<= "00000000"; end if; end process; end Behavioral; OUTPUT :
  • 11. EXPERIMENT-4 Aim: Write a VHDL program to implement a 4 bit adder. --program for 1 bit full adder. library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity fa is Port ( x : in STD_LOGIC; y : in STD_LOGIC; c : in STD_LOGIC; s : out STD_LOGIC; co : out STD_LOGIC); end fa; architecture Behavioral of fa is begin s<= x xor y xor c; co<= (x and y)or(y and c)or(c and x); end Behavioral; --program for 4 bit full adder. library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity fa_4bit is Port ( a : in STD_LOGIC_VECTOR (3 downto 0); b : in STD_LOGIC_VECTOR (3 downto 0); cin : in STD_LOGIC;
  • 12. sum : out STD_LOGIC_VECTOR (3 downto 0); cout : out STD_LOGIC); end fa_4bit; architecture Structural of fa_4bit is signal cs : std_logic_vector (2 downto 0); component fa port (x : in STD_LOGIC; y : in STD_LOGIC; c : in STD_LOGIC; s : out STD_LOGIC; co : out STD_LOGIC); end component; begin f1 : fa port map(a(0),b(0),cin,sum(0),cs(0)); f2 : fa port map(a(1),b(1),cs(0),sum(1),cs(1)); f3 : fa port map(a(2),b(2),cs(1),sum(2),cs(2)); f4 : fa port map(a(3),b(3),cs(2),sum(3),cout); end Structural; OUTPUT :
  • 13. EXPERIMENT-5 Aim: Write a VHDL program to implement a 4 bit comparator. library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity comprator_4bit is Port ( a : in STD_LOGIC_VECTOR (3 downto 0); b : in STD_LOGIC_VECTOR (3 downto 0); less : out STD_LOGIC; equal : out STD_LOGIC; greater : out STD_LOGIC); end comprator_4bit; architecture Behavioral of comprator_4bit is begin process(a,b) begin if (a>b) then greater <= '1'; equal <= '0'; less <= '0'; elsif (a<b) then greater <= '0'; equal <= '0'; less <= '1';
  • 14. else greater <= '0'; equal <= '1'; less <= '0'; end if; end process; end Behavioral; OUTPUT :
  • 15. EXPERIMENT-6 Aim: Write a VHDL program to design a 2 bit ALU containing 4 arithmetic and 4 logical operations. library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity alu_2bit is Port ( a : in STD_LOGIC_VECTOR (1 downto 0); b : in STD_LOGIC_VECTOR (1 downto 0); sel : in STD_LOGIC_VECTOR (2 downto 0); cin : in STD_LOGIC; y : out STD_LOGIC_VECTOR (1 downto 0)); end alu_2bit; architecture Behavioral of alu_2bit is signal arith,logic : STD_LOGIC_VECTOR (1 downto 0); begin with sel(1 downto 0) select arith <= a + 1 when "00", a + b + cin when "01", a - b when "10", b + 1 when others; with sel(1 downto 0) select logic <= not a when "00",
  • 16. a and b when "01", a or b when "10", a xor b when others; with sel(2) select y <= arith when '0', logic when others; end Behavioral; OUTPUT :
  • 17. EXPERIMENT-7 Aim: Write a VHDL program to design a D Flip Flop. library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity dff is Port ( d,clk, reset: in std_logic; q : out std_logic); end dff; architecture Behavioral of dff is begin process (clk, d) begin if ( (d'event or clk'event) and clk='1') then if RESET ='1' then q <= '0' ; else q <= d after 1 us; end if; end if; end process; end Behavioral;
  • 19. EXPERIMENT-8 Aim: Write a VHDL program to design a D Flip Flop. library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity dff is Port ( d,clk, reset: in std_logic; q : out std_logic); end dff; architecture Behavioral of dff is begin process (clk, d) begin if ( (d'event or clk'event) and clk='1') then if RESET ='1' then q <= '0' ; else q <= d after 1 us; end if; end if; end process; end Behavioral;