-- Albert Coba 1727 -- Shawn Nematbakhsh 8551 -- cs161 proj2: Datapath: -- a MIPS control -- this is the ALU control file, it recieves the ALUop signal and the -- opcode from the control and then sends the necessary signals -- to the ALU to do the correct operation. library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_arith.all; entity ALUControl is port( alu_op : in std_logic_vector( 1 downto 0 ); ins_5_0 : in std_logic_vector( 5 downto 0 ); alu_control : out std_logic_vector( 2 downto 0 ) ); end ALUControl; architecture bhv of ALUControl is begin process(alu_op) begin case alu_op is -- when 00 or 01, opcode doesn't matter when "00" => alu_control <= "010"; when "01" => alu_control <= "110"; when others => -- when 10, send different signal depending on opcode case ins_5_0(3 downto 0) is when "0000" => alu_control <= "010"; when "0010" => alu_control <= "110"; when "0100" => alu_control <= "000"; when "0101" => alu_control <= "001"; when "1010" => alu_control <= "111"; when others => end case; end case; end process; end bhv;