Experiment No. 6: Aim: Write VHDL Code For 2:4 Decoder Using If Statement. Software:Xilinx ISE 14.7 Theory
Experiment No. 6: Aim: Write VHDL Code For 2:4 Decoder Using If Statement. Software:Xilinx ISE 14.7 Theory
Experiment No. 6: Aim: Write VHDL Code For 2:4 Decoder Using If Statement. Software:Xilinx ISE 14.7 Theory
EXPERIMENT No. 6
Theory:
Decoder is a combinational circuit that has ‘n’ input lines and maximum of 2 n output lines. One of these outputs
will be active High based on the combination of inputs present, when the decoder is enabled. That means decoder
detects a particular code. The outputs of the decoder are nothing but the min terms of ‘n’ input
variables lineslines, when it is enabled.
0 0 0 0 0 1
0 1 0 0 1 0
1 0 0 1 0 0
1 1 1 0 0 0
Symbol:
Manjeet Singh
16BEC1046
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING
Circuit Diagram:
VHDL Code:
entity decoder2_4_16bec1046 is
Port ( a : in STD_LOGIC_VECTOR (1 downto 0);
c : out STD_LOGIC_VECTOR (3 downto 0));
end decoder1;
architecture Behavioral of decoder2_4_16bec1046 is
begin
process (a)
begin
if (a="00") then
c <= "0001";
elsif (a="01") then
c <= "0010";
elsif (a="10") then
c <= "0100";
else
c <= "1000";
end if;
end process;
end Behavioral;
Manjeet Singh
16BEC1046
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING
Output
Result: The 2:4 decoder was designed using if-else, select and case statement.
Manjeet Singh
16BEC1046