-- Copyright 2000 UCR all rights reserved
-- this program may be copy or altered so
-- long as this header stays intake
-- Original design Randy January rjanuary@cs.ucr.edu

library IEEE;
use IEEE.STD_LOGIC_1164.all;
use IEEE.STD_LOGIC_ARITH.all;

entity scpu_mux is
  
  port (
    reset   : in  std_logic;
    mux_sel : in  unsigned (1 downto 0);
    dp_in   : in  unsigned (31 downto 0);
    imm_in  : in  unsigned (31 downto 0);
    ram_in  : in  unsigned (31 downto 0);
    mux_out : out unsigned (31 downto 0)
    );
end scpu_mux;

architecture beh of scpu_mux is

begin 

  process(reset, mux_sel, dp_in, imm_in)
    begin
      if (reset = '1') then
        mux_out <= "00000000000000000000000000000000";
      else
        case mux_sel is
          when "00" => mux_out <=  imm_in;
          when "01" => mux_out <= dp_in;
          when "10" => mux_out <= ram_in;
          when others => null;
        end case;
      end if;
  end process;	  
end beh;


