data/full_repos/permissive/497530416/sequential/fetch.v
1: b'%Warning-IMPLICIT: data/full_repos/permissive/497530416/sequential/fetch.v:243: Signal definition not found, creating implicitly: \'updated_PC\'\n    assign updated_PC = valP;\n           ^~~~~~~~~~\n                   ... Use "/* verilator lint_off IMPLICIT */" and lint_on around source to disable this message.\n%Warning-LITENDIAN: data/full_repos/permissive/497530416/sequential/fetch.v:6: Little bit endian vector: MSB < LSB of bit range: 0:7\nreg [0:7] reg_AB;\n    ^\n%Warning-LITENDIAN: data/full_repos/permissive/497530416/sequential/fetch.v:11: Little bit endian vector: MSB < LSB of bit range: 0:7\nreg [0:7] instruction;\n    ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:103: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n        icode = instruction_memory[PC][7:4];\n                                  ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:104: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n        ifun =  instruction_memory[PC][3:0];\n                                  ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:126: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                reg_AB = {instruction_memory[PC+1]};\n                                            ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:134: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                reg_AB = {instruction_memory[PC+1]};\n                                            ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:137: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                valC = { instruction_memory[PC+9],\n                                           ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:138: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                                    instruction_memory[PC+8],\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:139: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                                    instruction_memory[PC+7],\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:140: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                                    instruction_memory[PC+6],\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:141: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                                    instruction_memory[PC+5],\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:142: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                                    instruction_memory[PC+4],\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:143: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                                    instruction_memory[PC+3],\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:144: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                                    instruction_memory[PC+2] };\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:150: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                reg_AB = {instruction_memory[PC+1]};\n                                            ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:153: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                valC = { instruction_memory[PC+9],\n                                           ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:154: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                                    instruction_memory[PC+8],\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:155: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                                    instruction_memory[PC+7],\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:156: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                                    instruction_memory[PC+6],\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:157: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                                    instruction_memory[PC+5],\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:158: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                                    instruction_memory[PC+4],\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:159: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                                    instruction_memory[PC+3],\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:160: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                                    instruction_memory[PC+2] };\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:166: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                reg_AB = {instruction_memory[PC+1]};\n                                            ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:169: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                valC = { instruction_memory[PC+9],\n                                           ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:170: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                                    instruction_memory[PC+8],\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:171: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                                    instruction_memory[PC+7],\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:172: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                                    instruction_memory[PC+6],\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:173: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                                    instruction_memory[PC+5],\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:174: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                                    instruction_memory[PC+4],\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:175: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                                    instruction_memory[PC+3],\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:176: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                                    instruction_memory[PC+2] };\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:182: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                reg_AB = {instruction_memory[PC+1]};\n                                            ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:190: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                valC = { instruction_memory[PC+8],\n                                           ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:191: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                        instruction_memory[PC+7],\n                                          ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:192: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                        instruction_memory[PC+6],\n                                          ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:193: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                        instruction_memory[PC+5],\n                                          ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:194: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                        instruction_memory[PC+4],\n                                          ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:195: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                        instruction_memory[PC+3],\n                                          ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:196: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                        instruction_memory[PC+2],\n                                          ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:197: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                        instruction_memory[PC+1] };\n                                          ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:203: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                valC = { instruction_memory[PC+8],\n                                           ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:204: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                        instruction_memory[PC+7],\n                                          ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:205: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                        instruction_memory[PC+6],\n                                          ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:206: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                        instruction_memory[PC+5],\n                                          ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:207: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                        instruction_memory[PC+4],\n                                          ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:208: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                        instruction_memory[PC+3],\n                                          ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:209: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                        instruction_memory[PC+2],\n                                          ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:210: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                        instruction_memory[PC+1] };\n                                          ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:221: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                reg_AB = {instruction_memory[PC+1]};\n                                            ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:229: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                           : ... In instance fetch\n                reg_AB = {instruction_memory[PC+1]};\n                                            ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/sequential/fetch.v:243: Operator ASSIGNW expects 1 bits on the Assign RHS, but Assign RHS\'s VARREF \'valP\' generates 64 bits.\n                                                                           : ... In instance fetch\n    assign updated_PC = valP;\n                      ^\n%Warning-UNSIGNED: data/full_repos/permissive/497530416/sequential/fetch.v:108: Comparison is constant due to unsigned arithmetic\n                                                                              : ... In instance fetch\n        if(icode>=4\'b0000 && icode<4\'b1100)\n                ^~\n%Error: Exiting due to 54 warning(s)\n'
module fetch(clk, PC, icode, ifun, rA, rB, valC, valP,
             memory_error, halt, invalid_instr);

input clk;
input [63:0] PC;
reg [0:7] reg_AB;

output reg [3:0] icode, ifun, rA, rB;
output reg [63:0] valC, valP;

reg [0:7] instruction;


reg [7:0] instruction_memory [0:127];






output reg memory_error, halt,invalid_instr;


initial begin
    halt = 0;
    instruction_memory[0]  = 8'b00010000;
    instruction_memory[1]  = 8'b01100000;
    instruction_memory[2]  = 8'b00000001;

    instruction_memory[3]  = 8'b00110000;
    instruction_memory[4]  = 8'b11110010;
    instruction_memory[5]  = 8'b11111111;
    instruction_memory[6]  = 8'b00000000;
    instruction_memory[7]  = 8'b00000000;
    instruction_memory[8]  = 8'b00000000;
    instruction_memory[9]  = 8'b00000000;
    instruction_memory[10] = 8'b00000000;
    instruction_memory[11] = 8'b00000000;
    instruction_memory[12] = 8'b00000000;

    instruction_memory[13] = 8'b00110000;
    instruction_memory[14] = 8'b11110011;
    instruction_memory[15] = 8'b00000101;
    instruction_memory[16] = 8'b00000000;
    instruction_memory[17] = 8'b00000000;
    instruction_memory[18] = 8'b00000000;
    instruction_memory[19] = 8'b00000000;
    instruction_memory[20] = 8'b00000000;
    instruction_memory[21] = 8'b00000000;
    instruction_memory[22] = 8'b00000000;

    instruction_memory[23] = 8'b00110000;
    instruction_memory[24] = 8'b11110100;
    instruction_memory[25] = 8'b00000101;
    instruction_memory[26] = 8'b00000000;
    instruction_memory[27] = 8'b00000000;
    instruction_memory[28] = 8'b00000000;
    instruction_memory[29] = 8'b00000000;
    instruction_memory[30] = 8'b00000000;
    instruction_memory[31] = 8'b00000000;
    instruction_memory[32] = 8'b00000000;

    instruction_memory[33] = 8'b00100000;
    instruction_memory[34] = 8'b01000101;

    instruction_memory[35] = 8'b01100000;
    instruction_memory[36] = 8'b00110100;

    instruction_memory[37] = 8'b00100101;
    instruction_memory[38] = 8'b01010110;

    instruction_memory[39] = 8'b01100001;
    instruction_memory[40] = 8'b00110101;

    instruction_memory[41] = 8'b01110011;
    instruction_memory[42] = 8'b00110100;
    instruction_memory[43] = 8'b00000000;
    instruction_memory[44] = 8'b00000000;
    instruction_memory[45] = 8'b00000000;
    instruction_memory[46] = 8'b00000000;
    instruction_memory[47] = 8'b00000000;
    instruction_memory[48] = 8'b00000000;
    instruction_memory[49] = 8'b00000000;

    instruction_memory[50] = 8'b00010000;
    instruction_memory[51] = 8'b00010000;

    instruction_memory[52] = 8'b01100000;
    instruction_memory[53] = 8'b00110101;

    instruction_memory[54] = 8'b00000000;
end

always @ (*)
    begin
        memory_error = 0;
        if(PC > 127)
        begin
            memory_error = 1;
        end


        icode = instruction_memory[PC][7:4];
        ifun =  instruction_memory[PC][3:0];



        if(icode>=4'b0000 && icode<4'b1100)
        begin
            invalid_instr = 0;
            case(icode)

            4'b0000:
            begin
                halt = 1;
                valP = PC + 64'd1;
            end

            4'b0001:
            begin
                valP = PC + 64'd1;
            end

            4'b0010:
            begin
                reg_AB = {instruction_memory[PC+1]};
                rA = reg_AB[0:3];
                rB = reg_AB[4:7];
                valP = PC + 64'd2;
            end

            4'b0011:
            begin
                reg_AB = {instruction_memory[PC+1]};
                rA = reg_AB[0:3];
                rB = reg_AB[4:7];
                valC = { instruction_memory[PC+9],
                                    instruction_memory[PC+8],
                                    instruction_memory[PC+7],
                                    instruction_memory[PC+6],
                                    instruction_memory[PC+5],
                                    instruction_memory[PC+4],
                                    instruction_memory[PC+3],
                                    instruction_memory[PC+2] };
                valP = PC + 64'd10;
            end
        
            4'b0100:
            begin
                reg_AB = {instruction_memory[PC+1]};
                rA = reg_AB[0:3];
                rB = reg_AB[4:7];
                valC = { instruction_memory[PC+9],
                                    instruction_memory[PC+8],
                                    instruction_memory[PC+7],
                                    instruction_memory[PC+6],
                                    instruction_memory[PC+5],
                                    instruction_memory[PC+4],
                                    instruction_memory[PC+3],
                                    instruction_memory[PC+2] };
                valP = PC + 64'd10;
            end
        
            4'b0101:
            begin
                reg_AB = {instruction_memory[PC+1]};
                rA = reg_AB[0:3];
                rB = reg_AB[4:7];
                valC = { instruction_memory[PC+9],
                                    instruction_memory[PC+8],
                                    instruction_memory[PC+7],
                                    instruction_memory[PC+6],
                                    instruction_memory[PC+5],
                                    instruction_memory[PC+4],
                                    instruction_memory[PC+3],
                                    instruction_memory[PC+2] };
                valP = PC + 64'd10;
            end

            4'b0110:
            begin
                reg_AB = {instruction_memory[PC+1]};
                rA = reg_AB[0:3];
                rB = reg_AB[4:7];
                valP = PC + 64'd2;
            end

            4'b0111:
            begin
                valC = { instruction_memory[PC+8],
                        instruction_memory[PC+7],
                        instruction_memory[PC+6],
                        instruction_memory[PC+5],
                        instruction_memory[PC+4],
                        instruction_memory[PC+3],
                        instruction_memory[PC+2],
                        instruction_memory[PC+1] };
                valP = PC + 64'd9;
            end

            4'b1000:
            begin
                valC = { instruction_memory[PC+8],
                        instruction_memory[PC+7],
                        instruction_memory[PC+6],
                        instruction_memory[PC+5],
                        instruction_memory[PC+4],
                        instruction_memory[PC+3],
                        instruction_memory[PC+2],
                        instruction_memory[PC+1] };
                valP = PC + 64'd9;
            end

            4'b1001:
            begin
                valP = PC + 64'd1;
            end

            4'b1010:
            begin
                reg_AB = {instruction_memory[PC+1]};
                rA = reg_AB[0:3];
                rB = reg_AB[4:7];
                valP = PC + 64'd2;
            end

            4'b1011:
            begin
                reg_AB = {instruction_memory[PC+1]};
                rA = reg_AB[0:3];
                rB = reg_AB[4:7];
                 valP = PC + 64'd2;
            end
            endcase

        end
        else
        begin
            invalid_instr = 1;
        end

    end
    assign updated_PC = valP;
endmodule
module fetch(clk, PC, icode, ifun, rA, rB, valC, valP,
             memory_error, halt, invalid_instr);


input clk;
input [63:0] PC;
reg [0:7] reg_AB;

output reg [3:0] icode, ifun, rA, rB;
output reg [63:0] valC, valP;

reg [0:7] instruction;


reg [7:0] instruction_memory [0:127];






output reg memory_error, halt,invalid_instr;


initial begin
    halt = 0;
    instruction_memory[0]  = 8'b00010000;
    instruction_memory[1]  = 8'b01100000;
    instruction_memory[2]  = 8'b00000001;

    instruction_memory[3]  = 8'b00110000;
    instruction_memory[4]  = 8'b11110010;
    instruction_memory[5]  = 8'b11111111;
    instruction_memory[6]  = 8'b00000000;
    instruction_memory[7]  = 8'b00000000;
    instruction_memory[8]  = 8'b00000000;
    instruction_memory[9]  = 8'b00000000;
    instruction_memory[10] = 8'b00000000;
    instruction_memory[11] = 8'b00000000;
    instruction_memory[12] = 8'b00000000;

    instruction_memory[13] = 8'b00110000;
    instruction_memory[14] = 8'b11110011;
    instruction_memory[15] = 8'b00000101;
    instruction_memory[16] = 8'b00000000;
    instruction_memory[17] = 8'b00000000;
    instruction_memory[18] = 8'b00000000;
    instruction_memory[19] = 8'b00000000;
    instruction_memory[20] = 8'b00000000;
    instruction_memory[21] = 8'b00000000;
    instruction_memory[22] = 8'b00000000;

    instruction_memory[23] = 8'b00110000;
    instruction_memory[24] = 8'b11110100;
    instruction_memory[25] = 8'b00000101;
    instruction_memory[26] = 8'b00000000;
    instruction_memory[27] = 8'b00000000;
    instruction_memory[28] = 8'b00000000;
    instruction_memory[29] = 8'b00000000;
    instruction_memory[30] = 8'b00000000;
    instruction_memory[31] = 8'b00000000;
    instruction_memory[32] = 8'b00000000;

    instruction_memory[33] = 8'b00100000;
    instruction_memory[34] = 8'b01000101;

    instruction_memory[35] = 8'b01100000;
    instruction_memory[36] = 8'b00110100;

    instruction_memory[37] = 8'b00100101;
    instruction_memory[38] = 8'b01010110;

    instruction_memory[39] = 8'b01100001;
    instruction_memory[40] = 8'b00110101;

    instruction_memory[41] = 8'b01110011;
    instruction_memory[42] = 8'b00110100;
    instruction_memory[43] = 8'b00000000;
    instruction_memory[44] = 8'b00000000;
    instruction_memory[45] = 8'b00000000;
    instruction_memory[46] = 8'b00000000;
    instruction_memory[47] = 8'b00000000;
    instruction_memory[48] = 8'b00000000;
    instruction_memory[49] = 8'b00000000;

    instruction_memory[50] = 8'b00010000;
    instruction_memory[51] = 8'b00010000;

    instruction_memory[52] = 8'b01100000;
    instruction_memory[53] = 8'b00110101;

    instruction_memory[54] = 8'b00000000;
end

always @ (*)
    begin
        memory_error = 0;
        if(PC > 127)
        begin
            memory_error = 1;
        end


        icode = instruction_memory[PC][7:4];
        ifun =  instruction_memory[PC][3:0];



        if(icode>=4'b0000 && icode<4'b1100)
        begin
            invalid_instr = 0;
            case(icode)

            4'b0000:
            begin
                halt = 1;
                valP = PC + 64'd1;
            end

            4'b0001:
            begin
                valP = PC + 64'd1;
            end

            4'b0010:
            begin
                reg_AB = {instruction_memory[PC+1]};
                rA = reg_AB[0:3];
                rB = reg_AB[4:7];
                valP = PC + 64'd2;
            end

            4'b0011:
            begin
                reg_AB = {instruction_memory[PC+1]};
                rA = reg_AB[0:3];
                rB = reg_AB[4:7];
                valC = { instruction_memory[PC+9],
                                    instruction_memory[PC+8],
                                    instruction_memory[PC+7],
                                    instruction_memory[PC+6],
                                    instruction_memory[PC+5],
                                    instruction_memory[PC+4],
                                    instruction_memory[PC+3],
                                    instruction_memory[PC+2] };
                valP = PC + 64'd10;
            end
        
            4'b0100:
            begin
                reg_AB = {instruction_memory[PC+1]};
                rA = reg_AB[0:3];
                rB = reg_AB[4:7];
                valC = { instruction_memory[PC+9],
                                    instruction_memory[PC+8],
                                    instruction_memory[PC+7],
                                    instruction_memory[PC+6],
                                    instruction_memory[PC+5],
                                    instruction_memory[PC+4],
                                    instruction_memory[PC+3],
                                    instruction_memory[PC+2] };
                valP = PC + 64'd10;
            end
        
            4'b0101:
            begin
                reg_AB = {instruction_memory[PC+1]};
                rA = reg_AB[0:3];
                rB = reg_AB[4:7];
                valC = { instruction_memory[PC+9],
                                    instruction_memory[PC+8],
                                    instruction_memory[PC+7],
                                    instruction_memory[PC+6],
                                    instruction_memory[PC+5],
                                    instruction_memory[PC+4],
                                    instruction_memory[PC+3],
                                    instruction_memory[PC+2] };
                valP = PC + 64'd10;
            end

            4'b0110:
            begin
                reg_AB = {instruction_memory[PC+1]};
                rA = reg_AB[0:3];
                rB = reg_AB[4:7];
                valP = PC + 64'd2;
            end

            4'b0111:
            begin
                valC = { instruction_memory[PC+8],
                        instruction_memory[PC+7],
                        instruction_memory[PC+6],
                        instruction_memory[PC+5],
                        instruction_memory[PC+4],
                        instruction_memory[PC+3],
                        instruction_memory[PC+2],
                        instruction_memory[PC+1] };
                valP = PC + 64'd9;
            end

            4'b1000:
            begin
                valC = { instruction_memory[PC+8],
                        instruction_memory[PC+7],
                        instruction_memory[PC+6],
                        instruction_memory[PC+5],
                        instruction_memory[PC+4],
                        instruction_memory[PC+3],
                        instruction_memory[PC+2],
                        instruction_memory[PC+1] };
                valP = PC + 64'd9;
            end

            4'b1001:
            begin
                valP = PC + 64'd1;
            end

            4'b1010:
            begin
                reg_AB = {instruction_memory[PC+1]};
                rA = reg_AB[0:3];
                rB = reg_AB[4:7];
                valP = PC + 64'd2;
            end

            4'b1011:
            begin
                reg_AB = {instruction_memory[PC+1]};
                rA = reg_AB[0:3];
                rB = reg_AB[4:7];
                 valP = PC + 64'd2;
            end
            endcase

        end
        else
        begin
            invalid_instr = 1;
        end

    end
    assign updated_PC = valP;
endmodule