VHDL Complete File
VHDL Complete File
-01
AIM :- To design various logic gates using VHDL and
study the output waveform.
(A) :- AND GATE
Program :-
library IEEE;
use IEEE.std_logic_1164.all;
entity and1 is
end and1;
begin
c<=(a and b) ;
end andg;
OUTPUT :-
(B) :- OR GATE
Program :-
library IEEE;
use IEEE.std_logic_1164.all;
entity or1 is
end or1;
begin
c<=(a or b) ;
end org;
OUTPUT :-
use IEEE.std_logic_1164.all;
entity not1 is
end not1;
begin
c<= not a ;
end notg;
OUTPUT :-
use IEEE.std_logic_1164.all;
entity nand1 is
end nand1;
c<= a nand b ;
end nandg;
OUTPUT :-
use IEEE.std_logic_1164.all;
entity nor1 is
end nor1;
begin
c<= a nor b ;
end norg;
OUTPUT :-
use IEEE.std_logic_1164.all;
entity xor1 is
end xor1;
begin
c<= a xor b ;
end xorg;
OUTPUT :-
Experiment No. -02
AIM :- To design a half adder circuit using VHDL.
Program :-
library ieee;
use ieee.std_logic_1164.all;
entity halfadder1 is
end halfadder1;
begin
sum<=a xor b;
carry<=a and b;
end halfadderg;
OUTPUT :-
Experiment No. -03
AIM :- To design a full adder circuit using VHDL.
Program :-
library ieee;
use ieee.std_logic_1164.all;
entity fulladder1 is
end fulladder1;
begin
end fulladderg;
OUTPUT :-
Experiment No. -04
AIM :- To design 3x8 DECODER using VHDL.
Program :-
library ieee;
use ieee.std_logic_1164.all;
entity decoder3x8 is
end decoder3x8;
begin
end decoderg;
OUTPUT :-
Experiment No. -05
AIM :- To design 8x3 ENCODER using VHDL.
Program :-
library ieee;
use ieee.std_logic_1164.all;
entity encoder8x3 is
end encoder8x3;
begin
end encoderg;
OUTPUT :- Z1 =1
Z3 =1
Z5 =1
Z7 = 1
Experiment No. -06
AIM :-To design D FLIP FLOP using VHDL.
Program :-
library ieee;
use ieee.std_logic_1164.all;
entity DFF is
end DFF;
begin
process(clk,D)
begin
if (clk='1') then
Q<=D;
end if;
end process;
end DFF1;
OUTPUT :-
Experiment No. -07
AIM :- To design 4x1 MUX using VHDL.
Program :-
library ieee;
use ieee.std_logic_1164.all;
entity mux4 is
end mux4;
begin
process(s0,s1) is
begin
z<=a;
z<=b;
z<=c;
else
z<=d;
end if;
end process;
end muxx;
OUTPUT :-
S0 =0 , S1=1
S0 =1 , S1=1
Experiment No. -08
AIM :- To design a shift register using VHDL.
Program :-
library ieee;
use ieee.std_logic_1164.all;
entity shiftregister is
end shiftregister;
begin
process(clk)
begin
Q(0)<= din;
end if;
end process;
end shr;
OUTPUT :-
Experiment No. -09
AIM :- To design a decimal counter using VHDL.
Program :-
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity dc1 is
end dc1;
architecture u1 of dc1 is
begin
process(clk)
begin
if d="1010" then
d<="0000";
d<=d+1;
end if;
end process;
q<=d;
end u1;
OUTPUT :-
Experiment No. -10
AIM :- To design F(A,B,C) = AB’ + AC(A’+B) using VHDL.
Program :-
library ieee;
use ieee.std_logic_1164.all;
entity function10 is
end function10;
begin
end function2;
OUTPUT :-