sel4_B.vhd


--
-- 4-to-1 data selector (use when-else statement)
--
library ieee;
use ieee.std_logic_1164.all;

entity sel4_B is
     port( dD : in std_logic;
         dC : in std_logic;
         dB : in std_logic;
         dA : in std_logic;
         sel : in std_logic_vector(1 downto 0);
         y : out std_logic);
end sel4_B;

architecture rtl of sel4_B is
begin

     y <= dD when (sel = "11") else
        dC when (sel = "10") else
        dB when (sel = "01") else
        dA;

end rtl;