Tuesday, 27 August 2013

vhdl program for 2x4 decoder

---------------------------------------------------------------------------------------------------
--
-- Title       : decoder
-- Design      : and1
-- Author      : rajashekar
-- Company     : kits
--
---------------------------------------------------------------------------------------------------
--
-- File        : decoder_2to4.vhd
-- Generated   : Wed Aug  7 20:13:22 2013
-- From        : interface description file
-- By          : Itf2Vhdl ver. 1.20
--
---------------------------------------------------------------------------------------------------
--
-- Description :
--
---------------------------------------------------------------------------------------------------

--{{ Section below this comment is automatically maintained
--   and may be overwritten
--{entity {decoder} architecture {decoder_behv}}

library IEEE;
use IEEE.STD_LOGIC_1164.all;


entity decoder_2to4 is
    port (i: in  STD_LOGIC_VECTOR (0 t0 1);
    b: out  STD_LOGIC_VECTOR (0 to 3)
    );
end decoder_2to4;


--}} End of automatically maintained section

architecture decoder_behv of decoder_2to4 is
begin
   
    with i select
    b<="0001" when "00",
    "0010" when "01",
    "0100" when "10",
    "1000" when "11",
    "XXXX" when others;

end decoder_behv;

No comments:

Post a Comment