Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Experiment No. 6: Aim: Write VHDL Code For 2:4 Decoder Using If Statement. Software:Xilinx ISE 14.7 Theory

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

EXPERIMENT No. 6

Aim: Write VHDL code for 2:4 decoder using if statement.

Software:Xilinx ISE 14.7.

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.

Boolean functions for each output as


D3=A.B,D2=A.B′,D1=A′.B,D0=A′.B′
Truth Table:
A B D3 D2 D1 D0

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

You might also like