alu_ctrl.vhd (627B)
1 library ieee; 2 use ieee.std_logic_1164.all; 3 4 entity alu_ctrl is port ( 5 funct: in std_logic_vector(5 downto 0); 6 alu_op: in std_logic_vector(1 downto 0); 7 op: out std_logic_vector(3 downto 0) 8 ); 9 end alu_ctrl; 10 11 architecture dataflow of alu_ctrl is 12 begin 13 op <= "0010" when (alu_op = "00" or (alu_op = "10" and funct = "100000")) else 14 "0110" when (alu_op = "01" or (alu_op = "10" and funct = "100010")) else 15 "0000" when (alu_op = "10" and funct = "100100") else 16 "0001" when (alu_op = "10" and funct = "100101") else 17 "0111" when (alu_op = "10" and funct = "101010") else 18 "1111"; 19 end dataflow;