--control inputs for the alu,rp
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all; 
use ieee.std_logic_arith.all; 

ENTITY ALUCONTROL IS PORT
        (input_function6                :in BIT_vector(5 downto 0);
         input_aluop2                   :in BIT_vector(1 downto 0);

         output_alucontrol3             :out BIT_vector(2 downto 0));

END ALUCONTROL;


Architecture ALUCONTROL_Arch of ALUCONTROL is
begin
        --process(input_function6,input_aluop2, clk)
        process(input_function6,input_aluop2)

        begin
        --if (clk'event and clk='1') then
                --I type
                if (input_aluop2="00") then    
					output_alucontrol3<="010";
           
                end if;
                
                --J type
                if (input_aluop2="01") then
                        output_alucontrol3<="110";
                end if;

                --R type
                if (input_aluop2="10") then
                        --add
                        if (input_function6="100000") then
                                output_alucontrol3<="010";
                        end if;
                        
                        --sub
                        if (input_function6="100010") then
                                output_alucontrol3<="110";
                        end if;
                        
                        --and
                        if (input_function6="100100") then
                                output_alucontrol3<="000";
                        end if;
                        
                        --or
                        if (input_function6="100101") then
                                output_alucontrol3<="001";
                        end if;
                        
                        --slt
                        if (input_function6="101010") then
                                output_alucontrol3<="111";
                        end if;
                end if;
                        
   --     end if;
        end process;
END ALUCONTROL_Arch;