Lab File: Submitted To Submitted by
Lab File: Submitted To Submitted by
LAB FILE
SUBMITTED TO
Mr. Sandeep Choudhary Assistant Professor ECE Dept.
SUBMITTED BY
Prabhjinder Singh Aulakh 2209139 ECE II
DEPARTMENT OF ELECTRONICS AND COMMUNUNICATION ENGINEERING SWAMI DEVI DYAL INSTITUTE OF ENGINEERING & TECHNOLOGY DISTT - PANCHKULA (BARWALA)
Sr. no 1 2 3 4 5 6 7 8 9 10 11 12
Program VHDL code for 2:4 Decoder VHDL code for 4:1 Multiplexer VHDL code for 1:4 Demultiplexer VHDL code for Full Adder VHDL code for Half Adder VHDL code for Half Subtractor VHDL code for D-FF VHDL code for T-FF VHDL Code for Parity Generator VHDL Code for 1 bit comparator VHDL code for up-down counter VHDL code for AND , OR , NAND and NOT gate
Page no 3 4 6 8 9 10 11 12 13 15 16 17
Date
Remark
EXPERIMENT NO. : 1
AIM: To implement VHDL code for 2:4 Decoder.
RTL SCHEMATICS
EXPERIMENT NO. 2
AIM: To implement VHDL code for 4:1 Multiplexer.
RTL SCHEMATICS
4:1 Multiplexer
EXPERIMENT NO. : 3
AIM: To implement VHDL code for 1:4 Demultiplexer.
RTL SCHEMATICS
4:1 Demultiplexer
EXPERIMENT NO. : 4
AIM: To implement VHDL code for Full Adder.
EXPERIMENT NO. : 5
AIM: To implement VHDL code for Half Adder.
EXPERIMENT NO. : 6
AIM: To implement VHDL code for Half subtractor.
10
EXPERIMENT NO. : 7
AIM: To implement VHDL code for D-FF.
11
EXPERIMENT NO. : 8
AIM: To implement VHDL code for T-FF.
12
EXPERIMENT NO. : 9
AIM: To implement VHDL code for Parity Generator.
13
RTL SCHEMATICS
14
EXPERIMENT NO. : 10
AIM : VHDL code for 1 Bit comparator in Behavioral Modeling style
15
EXPERIMENT NO. : 11
Aim: To implement Modulo Synchronous Up-Down Counter using VHDL. Apparatus used : Xilinx , Modelsim Software. Code: library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity counter is port(C, CLR, UP_DOWN : in std_logic; Q : out std_logic_vector(3 downto 0)); end counter; architecture archi of counter is signal tmp: std_logic_vector(3 downto 0); begin process (C, CLR) begin if (CLR='1') then tmp <= "0000"; elsif (C'event and C='1') then if (UP_DOWN='1') then tmp <= tmp + 1; else tmp <= tmp - 1; end if; end if; end process; Q <= tmp; end archi; Result : Modulo synchronous Up-Down Counter implemented using VHDL. RTL Schematics
16
EXPERIMENT : 12
Aim: To implement AND , OR , NAND and NOT gate using VHDL. apparatus used : Xilinx , Modelsim Software. Code: 1.1 AND GATE library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity AND2 is port(A,B : in std_logic; C : out std_logic); end AND2; architecture archi of AND2 is begin C <= A and B; end archi; Result:
1.2 OR GATE Code: library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity or1 is port(A,B : in std_logic; C : out std_logic); end or1;
17
1.3 NAND GATE Code: library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity nand1 is port(A,B : in std_logic; C : out std_logic); end nand1; architecture archi of nand1 is begin C <= A nand B; end archi; Result:
18
1.4 NOT GATE Code: library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity NOT1 is port(A : in std_logic; B : out std_logic); end NOT1; architecture archi of NOT1 is begin B<= not A; end archi; Result:
RESULT : AND , OR , NAND and NOT gate using VHDL has been implemented.
19