data/full_repos/permissive/506186384/project-files/lab6/ALUCtr.v
data/verilator_xmls/27f916a1-bb64-421f-af1b-302ac1165734.xml
module ALUCtr(
    input [3:0] ALUOp,
    input [5:0] Funct,
    output [3:0] ALUCtr,
    output jr,
    output shift
    );
    reg [3:0] aluCtr;
    reg JR;
    reg SHIFT;
    always @ (ALUOp or Funct)
    begin
        casex ({ALUOp, Funct})
            10'b0000xxxxxx: begin
                aluCtr = 4'b0010;
                JR = 0;
                SHIFT = 0;
            end
            10'b0110xxxxxx: begin
                aluCtr = 4'b1001;
                JR = 0;
                SHIFT = 0;
            end
            10'b0001xxxxxx: begin
                aluCtr = 4'b0110;
                JR = 0;
                SHIFT = 0;
            end
            10'b0011xxxxxx: begin
                aluCtr = 4'b0000;
                JR = 0;
                SHIFT = 0;
            end
            10'b0100xxxxxx: begin
                aluCtr = 4'b0001;
                JR = 0;
                SHIFT = 0;
            end
            10'b0101xxxxxx: begin
                aluCtr = 4'b0111;
                JR = 0;
                SHIFT = 0;
            end
            10'b0111xxxxxx: begin
                aluCtr = 4'b1000;
                JR = 0;
                SHIFT = 0;
            end
            10'b1000xxxxxx: begin
                aluCtr = 4'b1011;
                JR = 0;
                SHIFT = 0;
            end
            10'b1001xxxxxx: begin
                aluCtr = 4'b1101;
                JR = 0;
                SHIFT = 0;
            end

            10'b0010100000: begin
                aluCtr = 4'b0010;
                JR = 0;
                SHIFT = 0;
            end
            10'b0010100001: begin
                aluCtr = 4'b1001;
                JR = 0;
                SHIFT = 0;
            end
            10'b0010100010: begin
                aluCtr = 4'b0110;
                JR = 0;
                SHIFT = 0;
            end
            10'b0010100011: begin
                aluCtr = 4'b1010;
                JR = 0;
                SHIFT = 0;
            end
            10'b0010100100: begin
                aluCtr = 4'b0000;
                JR = 0;
                SHIFT = 0;
            end
            10'b0010100101: begin
                aluCtr = 4'b0001;
                JR = 0;
                SHIFT = 0;
            end
            10'b0010101010: begin
                aluCtr = 4'b0111;
                JR = 0;
                SHIFT = 0;
            end
            10'b0010101011: begin
                aluCtr = 4'b1000;
                JR = 0;
                SHIFT = 0;
            end
            10'b0010100111: begin
                aluCtr = 4'b1100;
                JR = 0;
                SHIFT = 0;
            end
            10'b0010000000: begin
                aluCtr = 4'b0011;
                JR = 0;
                SHIFT = 1;
            end
            10'b0010000010: begin
                aluCtr = 4'b0100;
                JR = 0;
                SHIFT = 1;
            end
            10'b0010001000: begin 
                aluCtr = 4'b1000;
                JR = 1;
                SHIFT = 0;
            end
            10'b0010100110: begin
                aluCtr = 4'b1101;
                JR = 0;
                SHIFT = 0;
            end
            10'b0010000011: begin
                aluCtr = 4'b1110;
                JR = 0;
                SHIFT = 1;
            end
            10'b0010000100: begin
                aluCtr = 4'b0011;
                JR = 0;
                SHIFT = 0;
            end
            10'b0010000110: begin
                aluCtr = 4'b0100;
                JR = 0;
                SHIFT = 0;
            end
            10'b0010000111: begin
                aluCtr = 4'b1110;
                JR = 0;
                SHIFT = 0;
            end
            default: aluCtr = 4'b0000;
        endcase
    end
    assign ALUCtr = aluCtr;
    assign jr = JR;
    assign shift = SHIFT;
endmodule
module ALUCtr(
    input [3:0] ALUOp,
    input [5:0] Funct,
    output [3:0] ALUCtr,
    output jr,
    output shift
    );

    reg [3:0] aluCtr;
    reg JR;
    reg SHIFT;
    always @ (ALUOp or Funct)
    begin
        casex ({ALUOp, Funct})
            10'b0000xxxxxx: begin
                aluCtr = 4'b0010;
                JR = 0;
                SHIFT = 0;
            end
            10'b0110xxxxxx: begin
                aluCtr = 4'b1001;
                JR = 0;
                SHIFT = 0;
            end
            10'b0001xxxxxx: begin
                aluCtr = 4'b0110;
                JR = 0;
                SHIFT = 0;
            end
            10'b0011xxxxxx: begin
                aluCtr = 4'b0000;
                JR = 0;
                SHIFT = 0;
            end
            10'b0100xxxxxx: begin
                aluCtr = 4'b0001;
                JR = 0;
                SHIFT = 0;
            end
            10'b0101xxxxxx: begin
                aluCtr = 4'b0111;
                JR = 0;
                SHIFT = 0;
            end
            10'b0111xxxxxx: begin
                aluCtr = 4'b1000;
                JR = 0;
                SHIFT = 0;
            end
            10'b1000xxxxxx: begin
                aluCtr = 4'b1011;
                JR = 0;
                SHIFT = 0;
            end
            10'b1001xxxxxx: begin
                aluCtr = 4'b1101;
                JR = 0;
                SHIFT = 0;
            end

            10'b0010100000: begin
                aluCtr = 4'b0010;
                JR = 0;
                SHIFT = 0;
            end
            10'b0010100001: begin
                aluCtr = 4'b1001;
                JR = 0;
                SHIFT = 0;
            end
            10'b0010100010: begin
                aluCtr = 4'b0110;
                JR = 0;
                SHIFT = 0;
            end
            10'b0010100011: begin
                aluCtr = 4'b1010;
                JR = 0;
                SHIFT = 0;
            end
            10'b0010100100: begin
                aluCtr = 4'b0000;
                JR = 0;
                SHIFT = 0;
            end
            10'b0010100101: begin
                aluCtr = 4'b0001;
                JR = 0;
                SHIFT = 0;
            end
            10'b0010101010: begin
                aluCtr = 4'b0111;
                JR = 0;
                SHIFT = 0;
            end
            10'b0010101011: begin
                aluCtr = 4'b1000;
                JR = 0;
                SHIFT = 0;
            end
            10'b0010100111: begin
                aluCtr = 4'b1100;
                JR = 0;
                SHIFT = 0;
            end
            10'b0010000000: begin
                aluCtr = 4'b0011;
                JR = 0;
                SHIFT = 1;
            end
            10'b0010000010: begin
                aluCtr = 4'b0100;
                JR = 0;
                SHIFT = 1;
            end
            10'b0010001000: begin 
                aluCtr = 4'b1000;
                JR = 1;
                SHIFT = 0;
            end
            10'b0010100110: begin
                aluCtr = 4'b1101;
                JR = 0;
                SHIFT = 0;
            end
            10'b0010000011: begin
                aluCtr = 4'b1110;
                JR = 0;
                SHIFT = 1;
            end
            10'b0010000100: begin
                aluCtr = 4'b0011;
                JR = 0;
                SHIFT = 0;
            end
            10'b0010000110: begin
                aluCtr = 4'b0100;
                JR = 0;
                SHIFT = 0;
            end
            10'b0010000111: begin
                aluCtr = 4'b1110;
                JR = 0;
                SHIFT = 0;
            end
            default: aluCtr = 4'b0000;
        endcase
    end
    assign ALUCtr = aluCtr;
    assign jr = JR;
    assign shift = SHIFT;
endmodule