SlideShare a Scribd company logo
1 of 23
DEN LAB
Digital Electronics
LAB WORK
DEN LAB
Steps to create project and execute in Modelsim
1: Open Modelsim
2: Go in menu : File-new-project
3: Give name to project – there should not be any space in the
name
4: POP UP window appears for new file
5: Click on create new file
6: Name your VHDL file –Check workspace
7: Click—OK and CANCEL/CLOSE
8: Double click on VHDL File
9: Editor Window Opens
10: Write your VHDL Program
11: Save
12: Compile
DEN LAB
13: Debug for error if any
14: Simulate
15: File is divided in three parts—i) Architecture, ii) package ieee,
iii) Package
16: Click on ARCHITECTURE
17: Go to view – signals
18: Signal names will appear in a pop up window.
Signal values can be changed here –
select the signal by click ---- go to edit—force—Click---POP UP
window appears—enter values
19: Back to –architecture—right click on architecture—click on add to
wave—waveform window opens.
Click RUN
Verify output
When you enter another set of signal values, do not press ADD TO
WAVE again, instead RUN directly.
DEN LAB
PROGRAM is of this type:
library ieee;
use ieee.std_logic_1164.all;
entity Nitin is
port(A: in std_logic;
B: in std_logic;
C: out std_logic);
end Nitin;
architecture Nitin_arch of Nitin is
begin
C<= A and B;
end Nitin_arch;
DEN LAB
HOW TO WRITE PRACTICAL JOURNAL?
DEN LAB
Left Hand Side: All in PENCIL (Blank side)
(left top corner)
( Date here) Experiment No. ____
AIM: --
Software Used:-
Diagram:-
Truth Table:-
Result:-
Conclusion:-
Right Hand Side: All in INK (Ruled side) (page no)
(right top corner)
Experiment No. _____ (Date here)
AIM:--
Software used:-
Procedure/Discussion:
Program:-(As word document print)
Result:
Conclusion:
Instruction: Do Not Start Next Experiment from back side of the end of previous experiment.
Start with a new page.
Use only one shade of BLUE INK through out the journal.
Leave
some
margin
here
on
LHS
DEN LAB
Instruction: Do Not Start Next Experiment from back side of the end of previous experiment.
Start with a new page.
Use only one shade of BLUE INK through out the journal.
Follow all the instructions given to you time to time.
DEN LAB
Experiment 1: To implement and verify basic gates using UNIVERSAL gates
DEN LAB
For NOT using NAND: Y<=X nand X;
For AND using NAND: Z<= X nand Y;
P<= Z nand Z;
For OR using NAND: X<= A nand A;
Y<= B nand B;
Z<= X nand Y;
For NOT using NOR: Y<=X NOR X;
For OR using NOR : Z<= X NOR Y;
P<= Z NOR Z;
For AND using NOR : X<= A NOR A;
Y<= B NOR B;
Z<= X NOR Y;
DEN LAB
To simulate and verify 16:1 MUX using 4:1 MUX
DEN LAB
Library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
entity s_4x1mux is
port(a,b,c,d : in std_logic;
S0,s1 : in std_logic;
q : out std_logic);
end s_4x1mux;
Architecture s_4x1mux1 of s_4x1mux is
Begin
Process(a,b,c,d,s0,s1)
Begin
If s0 ='0' and s1 ='0' then q <= a;
Elsif s0 ='1' and s1 ='0' then q <= b;
elsif s0 ='0' and s1='1' then q <= c;
else q <=d;
end if;
End process;
End s_4x1mux1;
DEN LAB
Library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
entity s_16x1mux is
port(a:in std_logic_vector(15 downto 0);
s: in std_logic_vector(3 downto 0);
Z:out std_logic);
End s_16x1mux;
Architecture s_16x1mux1 of s_16x1mux is
signal z1,z2,z3,z4:std_logic;
component s_4x1mux
port(a,b,c,d,s0,s1:in std_logic;
Q:out std_logic);
End component;
DEN LAB
Begin
M1: s_4x1mux port
map(a(0),a(1),a(2),a(3),s(0),s(1),z1);
m2: s_4x1mux port
map(a(4),a(5),a(6),a(7),s(0),s(1),z2);
m3: s_4x1mux port
map(a(8),a(9),a(10),a(11),s(0),s(1),z3);
m4: s_4x1mux port
map(a(12),a(13),a(14),a(15),s(0),s(1),z4);
m5: s_4x1mux port
map(z1,z2,z3,z4,s(2),s(3),z);
End s_16x1mux1;
DEN LAB
DEN LAB
DEN LAB
1:4 DEMUX
DEN LAB
library ieee;
use ieee.std_logic_1164.all;
entity demux_1to4 is
port(
F: in std_logic;
s0,s1 : in std_logic;
a,b,c,d : out std_logic);
end demux_1to4;
architecture bhy of demux_1to4 is
begin
process (F,s0,s1)
begin
if (s0=’0’ and s1 =’0’) then
a<= F;
elsif (s0=’1’ and s1=’0’) then
b<= F;
elsif (s0=’0’ and s1=’1’) then
c<=F;
else
d<=F;
end if;
end process;
end bhy;
DEN LAB
DEN LAB
Flip-Flop
DEN LAB
DEN LAB
DEN LAB
DEN LAB

More Related Content

Similar to DEN LAB 1.pptx

International Institute of technology (android)
International Institute of technology (android)International Institute of technology (android)
International Institute of technology (android)Nazih Heni
 
Hadoop Tutorial
Hadoop TutorialHadoop Tutorial
Hadoop Tutorialemedin
 
Vlsi lab manual exp:2
Vlsi lab manual exp:2Vlsi lab manual exp:2
Vlsi lab manual exp:2komala vani
 
Cn abi7500 setup_20120808e
Cn abi7500 setup_20120808eCn abi7500 setup_20120808e
Cn abi7500 setup_20120808eElsa von Licy
 
Prg 218 entire course
Prg 218 entire coursePrg 218 entire course
Prg 218 entire coursegrades4u
 
VLSI lab manual Part B, VTU 7the sem KIT-tiptur
VLSI lab manual Part B, VTU 7the sem KIT-tipturVLSI lab manual Part B, VTU 7the sem KIT-tiptur
VLSI lab manual Part B, VTU 7the sem KIT-tipturPramod Kumar S
 
EC6612 VLSI Design Lab Manual
EC6612 VLSI Design Lab ManualEC6612 VLSI Design Lab Manual
EC6612 VLSI Design Lab Manualtamil arasan
 
Install Project INK
Install Project INKInstall Project INK
Install Project INKIshanJoshi36
 
6.1.2 用eclipse环境调试一步一步学repast操作
6.1.2 用eclipse环境调试一步一步学repast操作6.1.2 用eclipse环境调试一步一步学repast操作
6.1.2 用eclipse环境调试一步一步学repast操作zhang shuren
 
Implementation of halstead
Implementation of halsteadImplementation of halstead
Implementation of halsteadvamshi batchu
 
INTRODUCTION TO MACHINE LEARNING FOR MATERIALS SCIENCE
INTRODUCTION TO MACHINE LEARNING FOR MATERIALS SCIENCEINTRODUCTION TO MACHINE LEARNING FOR MATERIALS SCIENCE
INTRODUCTION TO MACHINE LEARNING FOR MATERIALS SCIENCEIPutuAdiPratama
 
ABC Consolidated Financial InfoABC Companys current financial inf.docx
ABC Consolidated Financial InfoABC Companys current financial inf.docxABC Consolidated Financial InfoABC Companys current financial inf.docx
ABC Consolidated Financial InfoABC Companys current financial inf.docxransayo
 

Similar to DEN LAB 1.pptx (20)

International Institute of technology (android)
International Institute of technology (android)International Institute of technology (android)
International Institute of technology (android)
 
Hadoop Tutorial
Hadoop TutorialHadoop Tutorial
Hadoop Tutorial
 
Vlsi lab manual exp:2
Vlsi lab manual exp:2Vlsi lab manual exp:2
Vlsi lab manual exp:2
 
Cn abi7500 setup_20120808e
Cn abi7500 setup_20120808eCn abi7500 setup_20120808e
Cn abi7500 setup_20120808e
 
Xilinx verilog tutorial
Xilinx verilog tutorialXilinx verilog tutorial
Xilinx verilog tutorial
 
Dsplab v1
Dsplab v1Dsplab v1
Dsplab v1
 
Prg 218 entire course
Prg 218 entire coursePrg 218 entire course
Prg 218 entire course
 
VLSI lab manual Part B, VTU 7the sem KIT-tiptur
VLSI lab manual Part B, VTU 7the sem KIT-tipturVLSI lab manual Part B, VTU 7the sem KIT-tiptur
VLSI lab manual Part B, VTU 7the sem KIT-tiptur
 
groovy & grails - lecture 5
groovy & grails - lecture 5groovy & grails - lecture 5
groovy & grails - lecture 5
 
Testing Workshop
Testing WorkshopTesting Workshop
Testing Workshop
 
Mentor manual
Mentor manualMentor manual
Mentor manual
 
EC6612 VLSI Design Lab Manual
EC6612 VLSI Design Lab ManualEC6612 VLSI Design Lab Manual
EC6612 VLSI Design Lab Manual
 
Android programming-basics
Android programming-basicsAndroid programming-basics
Android programming-basics
 
How To Diffuse
How To DiffuseHow To Diffuse
How To Diffuse
 
Install Project INK
Install Project INKInstall Project INK
Install Project INK
 
6.1.2 用eclipse环境调试一步一步学repast操作
6.1.2 用eclipse环境调试一步一步学repast操作6.1.2 用eclipse环境调试一步一步学repast操作
6.1.2 用eclipse环境调试一步一步学repast操作
 
Implementation of halstead
Implementation of halsteadImplementation of halstead
Implementation of halstead
 
INTRODUCTION TO MACHINE LEARNING FOR MATERIALS SCIENCE
INTRODUCTION TO MACHINE LEARNING FOR MATERIALS SCIENCEINTRODUCTION TO MACHINE LEARNING FOR MATERIALS SCIENCE
INTRODUCTION TO MACHINE LEARNING FOR MATERIALS SCIENCE
 
MD51 Lab Manual
MD51 Lab ManualMD51 Lab Manual
MD51 Lab Manual
 
ABC Consolidated Financial InfoABC Companys current financial inf.docx
ABC Consolidated Financial InfoABC Companys current financial inf.docxABC Consolidated Financial InfoABC Companys current financial inf.docx
ABC Consolidated Financial InfoABC Companys current financial inf.docx
 

More from AshwiniMate10

More from AshwiniMate10 (8)

Unit 1.pptx
Unit 1.pptxUnit 1.pptx
Unit 1.pptx
 
Computer Architecture.pptx
Computer Architecture.pptxComputer Architecture.pptx
Computer Architecture.pptx
 
HOOVER PPT REVIEW PAPER (2) (1).pptx
HOOVER PPT REVIEW PAPER (2) (1).pptxHOOVER PPT REVIEW PAPER (2) (1).pptx
HOOVER PPT REVIEW PAPER (2) (1).pptx
 
class17A.ppt
class17A.pptclass17A.ppt
class17A.ppt
 
PHYS_3342_120111.ppt
PHYS_3342_120111.pptPHYS_3342_120111.ppt
PHYS_3342_120111.ppt
 
Kmaps.ppt
Kmaps.pptKmaps.ppt
Kmaps.ppt
 
encoderdecoder.pptx
encoderdecoder.pptxencoderdecoder.pptx
encoderdecoder.pptx
 
Unit-1.pptx
Unit-1.pptxUnit-1.pptx
Unit-1.pptx
 

Recently uploaded

Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas SachpazisSeismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas SachpazisDr.Costas Sachpazis
 
Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1T.D. Shashikala
 
5G and 6G refer to generations of mobile network technology, each representin...
5G and 6G refer to generations of mobile network technology, each representin...5G and 6G refer to generations of mobile network technology, each representin...
5G and 6G refer to generations of mobile network technology, each representin...archanaece3
 
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024EMMANUELLEFRANCEHELI
 
Autodesk Construction Cloud (Autodesk Build).pptx
Autodesk Construction Cloud (Autodesk Build).pptxAutodesk Construction Cloud (Autodesk Build).pptx
Autodesk Construction Cloud (Autodesk Build).pptxMustafa Ahmed
 
The Entity-Relationship Model(ER Diagram).pptx
The Entity-Relationship Model(ER Diagram).pptxThe Entity-Relationship Model(ER Diagram).pptx
The Entity-Relationship Model(ER Diagram).pptxMANASINANDKISHORDEOR
 
UNIT-2 image enhancement.pdf Image Processing Unit 2 AKTU
UNIT-2 image enhancement.pdf Image Processing Unit 2 AKTUUNIT-2 image enhancement.pdf Image Processing Unit 2 AKTU
UNIT-2 image enhancement.pdf Image Processing Unit 2 AKTUankushspencer015
 
Passive Air Cooling System and Solar Water Heater.ppt
Passive Air Cooling System and Solar Water Heater.pptPassive Air Cooling System and Solar Water Heater.ppt
Passive Air Cooling System and Solar Water Heater.pptamrabdallah9
 
Artificial Intelligence in due diligence
Artificial Intelligence in due diligenceArtificial Intelligence in due diligence
Artificial Intelligence in due diligencemahaffeycheryld
 
engineering chemistry power point presentation
engineering chemistry  power point presentationengineering chemistry  power point presentation
engineering chemistry power point presentationsj9399037128
 
Fuzzy logic method-based stress detector with blood pressure and body tempera...
Fuzzy logic method-based stress detector with blood pressure and body tempera...Fuzzy logic method-based stress detector with blood pressure and body tempera...
Fuzzy logic method-based stress detector with blood pressure and body tempera...IJECEIAES
 
Dynamo Scripts for Task IDs and Space Naming.pptx
Dynamo Scripts for Task IDs and Space Naming.pptxDynamo Scripts for Task IDs and Space Naming.pptx
Dynamo Scripts for Task IDs and Space Naming.pptxMustafa Ahmed
 
Adsorption (mass transfer operations 2) ppt
Adsorption (mass transfer operations 2) pptAdsorption (mass transfer operations 2) ppt
Adsorption (mass transfer operations 2) pptjigup7320
 
handbook on reinforce concrete and detailing
handbook on reinforce concrete and detailinghandbook on reinforce concrete and detailing
handbook on reinforce concrete and detailingAshishSingh1301
 
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdflitvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdfAlexander Litvinenko
 
Software Engineering Practical File Front Pages.pdf
Software Engineering Practical File Front Pages.pdfSoftware Engineering Practical File Front Pages.pdf
Software Engineering Practical File Front Pages.pdfssuser5c9d4b1
 
Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Ramkumar k
 
Filters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility ApplicationsFilters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility ApplicationsMathias Magdowski
 
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdfInstruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdfEr.Sonali Nasikkar
 
Involute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdf
Involute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdfInvolute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdf
Involute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdfJNTUA
 

Recently uploaded (20)

Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas SachpazisSeismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
 
Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1
 
5G and 6G refer to generations of mobile network technology, each representin...
5G and 6G refer to generations of mobile network technology, each representin...5G and 6G refer to generations of mobile network technology, each representin...
5G and 6G refer to generations of mobile network technology, each representin...
 
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
 
Autodesk Construction Cloud (Autodesk Build).pptx
Autodesk Construction Cloud (Autodesk Build).pptxAutodesk Construction Cloud (Autodesk Build).pptx
Autodesk Construction Cloud (Autodesk Build).pptx
 
The Entity-Relationship Model(ER Diagram).pptx
The Entity-Relationship Model(ER Diagram).pptxThe Entity-Relationship Model(ER Diagram).pptx
The Entity-Relationship Model(ER Diagram).pptx
 
UNIT-2 image enhancement.pdf Image Processing Unit 2 AKTU
UNIT-2 image enhancement.pdf Image Processing Unit 2 AKTUUNIT-2 image enhancement.pdf Image Processing Unit 2 AKTU
UNIT-2 image enhancement.pdf Image Processing Unit 2 AKTU
 
Passive Air Cooling System and Solar Water Heater.ppt
Passive Air Cooling System and Solar Water Heater.pptPassive Air Cooling System and Solar Water Heater.ppt
Passive Air Cooling System and Solar Water Heater.ppt
 
Artificial Intelligence in due diligence
Artificial Intelligence in due diligenceArtificial Intelligence in due diligence
Artificial Intelligence in due diligence
 
engineering chemistry power point presentation
engineering chemistry  power point presentationengineering chemistry  power point presentation
engineering chemistry power point presentation
 
Fuzzy logic method-based stress detector with blood pressure and body tempera...
Fuzzy logic method-based stress detector with blood pressure and body tempera...Fuzzy logic method-based stress detector with blood pressure and body tempera...
Fuzzy logic method-based stress detector with blood pressure and body tempera...
 
Dynamo Scripts for Task IDs and Space Naming.pptx
Dynamo Scripts for Task IDs and Space Naming.pptxDynamo Scripts for Task IDs and Space Naming.pptx
Dynamo Scripts for Task IDs and Space Naming.pptx
 
Adsorption (mass transfer operations 2) ppt
Adsorption (mass transfer operations 2) pptAdsorption (mass transfer operations 2) ppt
Adsorption (mass transfer operations 2) ppt
 
handbook on reinforce concrete and detailing
handbook on reinforce concrete and detailinghandbook on reinforce concrete and detailing
handbook on reinforce concrete and detailing
 
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdflitvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
 
Software Engineering Practical File Front Pages.pdf
Software Engineering Practical File Front Pages.pdfSoftware Engineering Practical File Front Pages.pdf
Software Engineering Practical File Front Pages.pdf
 
Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)
 
Filters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility ApplicationsFilters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility Applications
 
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdfInstruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
 
Involute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdf
Involute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdfInvolute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdf
Involute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdf
 

DEN LAB 1.pptx

  • 2. DEN LAB Steps to create project and execute in Modelsim 1: Open Modelsim 2: Go in menu : File-new-project 3: Give name to project – there should not be any space in the name 4: POP UP window appears for new file 5: Click on create new file 6: Name your VHDL file –Check workspace 7: Click—OK and CANCEL/CLOSE 8: Double click on VHDL File 9: Editor Window Opens 10: Write your VHDL Program 11: Save 12: Compile
  • 3. DEN LAB 13: Debug for error if any 14: Simulate 15: File is divided in three parts—i) Architecture, ii) package ieee, iii) Package 16: Click on ARCHITECTURE 17: Go to view – signals 18: Signal names will appear in a pop up window. Signal values can be changed here – select the signal by click ---- go to edit—force—Click---POP UP window appears—enter values 19: Back to –architecture—right click on architecture—click on add to wave—waveform window opens. Click RUN Verify output When you enter another set of signal values, do not press ADD TO WAVE again, instead RUN directly.
  • 4. DEN LAB PROGRAM is of this type: library ieee; use ieee.std_logic_1164.all; entity Nitin is port(A: in std_logic; B: in std_logic; C: out std_logic); end Nitin; architecture Nitin_arch of Nitin is begin C<= A and B; end Nitin_arch;
  • 5. DEN LAB HOW TO WRITE PRACTICAL JOURNAL?
  • 6. DEN LAB Left Hand Side: All in PENCIL (Blank side) (left top corner) ( Date here) Experiment No. ____ AIM: -- Software Used:- Diagram:- Truth Table:- Result:- Conclusion:- Right Hand Side: All in INK (Ruled side) (page no) (right top corner) Experiment No. _____ (Date here) AIM:-- Software used:- Procedure/Discussion: Program:-(As word document print) Result: Conclusion: Instruction: Do Not Start Next Experiment from back side of the end of previous experiment. Start with a new page. Use only one shade of BLUE INK through out the journal. Leave some margin here on LHS
  • 7. DEN LAB Instruction: Do Not Start Next Experiment from back side of the end of previous experiment. Start with a new page. Use only one shade of BLUE INK through out the journal. Follow all the instructions given to you time to time.
  • 8. DEN LAB Experiment 1: To implement and verify basic gates using UNIVERSAL gates
  • 9. DEN LAB For NOT using NAND: Y<=X nand X; For AND using NAND: Z<= X nand Y; P<= Z nand Z; For OR using NAND: X<= A nand A; Y<= B nand B; Z<= X nand Y; For NOT using NOR: Y<=X NOR X; For OR using NOR : Z<= X NOR Y; P<= Z NOR Z; For AND using NOR : X<= A NOR A; Y<= B NOR B; Z<= X NOR Y;
  • 10. DEN LAB To simulate and verify 16:1 MUX using 4:1 MUX
  • 11. DEN LAB Library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; entity s_4x1mux is port(a,b,c,d : in std_logic; S0,s1 : in std_logic; q : out std_logic); end s_4x1mux; Architecture s_4x1mux1 of s_4x1mux is Begin Process(a,b,c,d,s0,s1) Begin If s0 ='0' and s1 ='0' then q <= a; Elsif s0 ='1' and s1 ='0' then q <= b; elsif s0 ='0' and s1='1' then q <= c; else q <=d; end if; End process; End s_4x1mux1;
  • 12. DEN LAB Library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; entity s_16x1mux is port(a:in std_logic_vector(15 downto 0); s: in std_logic_vector(3 downto 0); Z:out std_logic); End s_16x1mux; Architecture s_16x1mux1 of s_16x1mux is signal z1,z2,z3,z4:std_logic; component s_4x1mux port(a,b,c,d,s0,s1:in std_logic; Q:out std_logic); End component;
  • 13. DEN LAB Begin M1: s_4x1mux port map(a(0),a(1),a(2),a(3),s(0),s(1),z1); m2: s_4x1mux port map(a(4),a(5),a(6),a(7),s(0),s(1),z2); m3: s_4x1mux port map(a(8),a(9),a(10),a(11),s(0),s(1),z3); m4: s_4x1mux port map(a(12),a(13),a(14),a(15),s(0),s(1),z4); m5: s_4x1mux port map(z1,z2,z3,z4,s(2),s(3),z); End s_16x1mux1;
  • 17. DEN LAB library ieee; use ieee.std_logic_1164.all; entity demux_1to4 is port( F: in std_logic; s0,s1 : in std_logic; a,b,c,d : out std_logic); end demux_1to4; architecture bhy of demux_1to4 is begin process (F,s0,s1) begin if (s0=’0’ and s1 =’0’) then a<= F; elsif (s0=’1’ and s1=’0’) then b<= F; elsif (s0=’0’ and s1=’1’) then c<=F; else d<=F; end if; end process; end bhy;