----------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------
|
-- Company:
|
-- Engineer: Joao Carlos Nunes Bittencourt
|
-- Engineer:
|
----------------------------------------------------------------------------------
|
--
|
-- Create Date: 13:18:18 03/06/2012
|
-- Create Date: 15:02:04 04/19/2012
|
----------------------------------------------------------------------------------
|
-- Design Name: Multiplexer 3 x 1
|
-- Design Name: 4x1 Multiplexer
|
-- Module Name: mux4x1 - Multiplex
|
-- Module Name: mux4x1 - behavioral
|
-- Project Name:
|
----------------------------------------------------------------------------------
|
-- Target Devices:
|
-- Project Name: 16-bit uRISC Processor
|
-- Tool versions:
|
----------------------------------------------------------------------------------
|
-- Description:
|
|
--
|
|
-- Dependencies:
|
|
--
|
|
-- Revision:
|
-- Revision:
|
-- Revision 0.01 - File Created
|
-- 1.0 - File Created
|
-- Additional Comments:
|
-- 2.0 - Project refactoring
|
--
|
--
|
----------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------
|
library ieee;
|
library ieee;
|
use ieee.std_logic_1164.all;
|
use ieee.std_logic_1164.all;
|
|
|
entity mux4x1 is
|
entity mux4x1 is
|
generic (
|
generic (
|
WIDTH : integer := 16 );
|
WIDTH : integer := 16 );
|
port (
|
port (
|
sink_a : in std_logic_vector (WIDTH-1 downto 0);
|
sink_a : in std_logic_vector (WIDTH-1 downto 0);
|
sink_b : in std_logic_vector (WIDTH-1 downto 0);
|
sink_b : in std_logic_vector (WIDTH-1 downto 0);
|
sink_c : in std_logic_vector (WIDTH-1 downto 0);
|
sink_c : in std_logic_vector (WIDTH-1 downto 0);
|
sink_d : in std_logic_vector (WIDTH-1 downto 0);
|
sink_d : in std_logic_vector (WIDTH-1 downto 0);
|
sink_sel : in std_logic_vector (1 downto 0);
|
sink_sel : in std_logic_vector (1 downto 0);
|
src_data : out std_logic_vector (WIDTH-1 downto 0) );
|
src_data : out std_logic_vector (WIDTH-1 downto 0) );
|
end mux4x1;
|
end mux4x1;
|
|
|
architecture Multiplex of mux4x1 is
|
architecture Multiplex of mux4x1 is
|
begin
|
begin
|
process(sink_sel, sink_a, sink_b, sink_c)
|
process(sink_sel, sink_a, sink_b, sink_c)
|
begin
|
begin
|
case sink_sel is
|
case sink_sel is
|
when "00" => src_data <= sink_a;
|
when "00" => src_data <= sink_a;
|
when "01" => src_data <= sink_b;
|
when "01" => src_data <= sink_b;
|
when "10" => src_data <= sink_c;
|
when "10" => src_data <= sink_c;
|
when "11" => src_data <= sink_d;
|
when "11" => src_data <= sink_d;
|
when others => src_data <= (others => '0');
|
when others => src_data <= (others => '0');
|
end case;
|
end case;
|
end process;
|
end process;
|
|
|
end Multiplex;
|
end Multiplex;
|
|
|
|
|