Experiment-5: Aim: To Write VHDL Code For 2:4 Decoder, Observe The Waveform and Synthesize The Code With
Experiment-5: Aim: To Write VHDL Code For 2:4 Decoder, Observe The Waveform and Synthesize The Code With
Experiment-5: Aim: To Write VHDL Code For 2:4 Decoder, Observe The Waveform and Synthesize The Code With
Aim: To write VHDL code for 2:4 decoder, observe the waveform and synthesize the code with
technological library with given Constraints.
Apparatus: Modelsim PE Student Edition 11.1 Software
Theory:
A decoder is a combinational circuit that converts binary information from n inputs line to a
maximum of 2^n unique output lines.
VHDL Code:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity Decoder is
port (A : in STD_LOGIC_VECTOR(1 downto 0); E : in STD_LOGIC;D : out
STD_LOGIC_VECTOR (3 downto 0));
end Decoder;
1
architecture behavioral of Decoder is
begin
process (A)
begin
if(E = '1')
then
case A is
when "00"=> D<="0001";
when "01"=> D<="0010";
when "10"=> D<="0100";
when "11"=> D<="1000";
end case;
end if;
end process;
end behavioral;