Forum Discussion
Altera_Forum
Honored Contributor
8 years ago--mux32bit
library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; use ieee.numeric_std; entity mux_aluop is port ( in1: in std_logic_vector(31 downto 0); in2: in std_LOGIC_VECTOR(31 downto 0); in3: in std_logic_vector(31 downto 0); mux_select: in STD_LOGIC_vector(1 downto 0); mux_out: out STD_LOGIC_VECTOR(31 downto 0) ); end mux_aluop; architecture behave of mux_aluop is begin process(mux_select) begin if mux_select = "00" then mux_out<=in1; elsif mux_select = "01" then mux_out<=in2; elsif mux_select = "10" then mux_out<=in3; end if; end process; end behave;