4x1 Multiplexer Using 2x1
4x1 Multiplexer Using 2x1
code:
Truth Table:
use IEEE.STD_LOGIC_1164.ALL;
--use IEEE.NUMERIC_STD.ALL;
--library UNISIM;
--use UNISIM.VComponents.all;
entity MUX2X1_MODULE is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
S : in STD_LOGIC;
M : out STD_LOGIC);
end MUX2X1_MODULE;
architecture Behavioral of MUX2X1_MODULE is
begin
end Behavioral;
use IEEE.STD_LOGIC_1164.ALL;
--use IEEE.NUMERIC_STD.ALL;
--library UNISIM;
--use UNISIM.VComponents.all;
entity MUXSTRUCT4X1_MODULE is
Port ( I1 : in STD_LOGIC;
I2 : in STD_LOGIC;
I3 : in STD_LOGIC;
S0 : in STD_LOGIC;
S1 : in STD_LOGIC;
I0 : in STD_LOGIC;
Y : out STD_LOGIC);
end MUXSTRUCT4X1_MODULE;
COMPONENT MUX2X1_MODULE is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
S : in STD_LOGIC;
M : out STD_LOGIC);
end COMPONENT;
SIGNAL X1,X2:STD_LOGIC;
begin
end Behavioral;
USE ieee.std_logic_1164.ALL;
--USE ieee.numeric_std.ALL;
ENTITY MUX4X1_TEST IS
END MUX4X1_TEST;
COMPONENT MUXSTRUCT4X1_MODULE
PORT(
I1 : IN std_logic;
I2 : IN std_logic;
I3 : IN std_logic;
S0 : IN std_logic;
S1 : IN std_logic;
I0 : IN std_logic;
Y : OUT std_logic
);
END COMPONENT;
--Inputs
--Outputs
signal Y : std_logic;
BEGIN
I1 => I1,
I2 => I2,
I3 => I3,
S0 => S0,
S1 => S1,
I0 => I0,
Y => Y
);
-- <clock>_process :process
-- begin
-- end process;
-- Stimulus process
stim_proc: process
begin
I0<='1';
I1<='0';
I2<='1';
I3<='0';
S0<='0';
S1<='0';
S0<='1';
S1<='0';
S0<='0';
S1<='1';
S0<='1';
S1<='1';
wait;
end process;
END;