data/full_repos/permissive/436123010/design_sources/ALU_Control.v
data/verilator_xmls/618ec0dc-b79a-47f1-9ec8-66b4dead0dcd.xml
module ALU_Control(
    input wire [2:0] control,
    input wire [5:0] funct,
    output reg [3:0] alu_control
    );
    always @*
    begin
        case(control)
            3'b000:
                begin
                    alu_control  = 4'b0010;
                end
            3'b100:
                begin
                    alu_control = 4'b0111;
                end
            3'b001:
                begin
                    alu_control = 4'b0110;
                end
            3'b010:
                begin
                    case(funct)
                        6'b100000:
                            alu_control = 4'b0010;
                        6'b100001:
                            alu_control = 4'b0010;
                        6'b100010:
                            alu_control = 4'b0110;
                        6'b100100:
                            alu_control = 4'b0000;
                        6'b100101:
                            alu_control = 4'b0001;
                        6'b101010:
                            alu_control = 4'b0111;
                        6'b101011:
                            alu_control = 4'b0111;
                        6'b000000:
                            alu_control = 4'b1111;
                    endcase
                end                 
        endcase
    end    
endmodule
module ALU_Control(
    input wire [2:0] control,
    input wire [5:0] funct,
    output reg [3:0] alu_control
    );

    always @*
    begin
        case(control)
            3'b000:
                begin
                    alu_control  = 4'b0010;
                end
            3'b100:
                begin
                    alu_control = 4'b0111;
                end
            3'b001:
                begin
                    alu_control = 4'b0110;
                end
            3'b010:
                begin
                    case(funct)
                        6'b100000:
                            alu_control = 4'b0010;
                        6'b100001:
                            alu_control = 4'b0010;
                        6'b100010:
                            alu_control = 4'b0110;
                        6'b100100:
                            alu_control = 4'b0000;
                        6'b100101:
                            alu_control = 4'b0001;
                        6'b101010:
                            alu_control = 4'b0111;
                        6'b101011:
                            alu_control = 4'b0111;
                        6'b000000:
                            alu_control = 4'b1111;
                    endcase
                end                 
        endcase
    end    
endmodule