001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017
018
019
020
021
022
023
024
025
026
027
028
029
030
031
032
033
034 | --******************************************************************************
--* *
--* 4 x 4 selector *
--* Device : XC9536-PC44 *
--* Author : Seiichi Inoue *
--******************************************************************************
library ieee; -- Defines std_logic types
use ieee.std_logic_1164.all;
entity Selector1 is
port ( A, B, C, D : in std_logic_vector(3 downto 0); -- Defines ports
Q : out std_logic_vector(3 downto 0);
SEL : in std_logic_vector(1 downto 0));
end;
architecture Selector1_arch of Selector1 is
begin
process( SEL ) begin
if SEL = "00" then
Q <= A; -- SEL=00 A -> OUT
elsif SEL = "01" then
Q <= B; -- SEL=01 B -> OUT
elsif SEL = "10" then
Q <= C; -- SEL=10 C -> OUT
else
Q <= D; -- SEL=11 D -> OUT
end if;
end process;
end Selector1_arch;
--******************************************************************************
--* end of 4 x 4 selector *
--****************************************************************************** |