I-type

I-Format Instruction Layout

  • The funct7 and rs2 fields from R-format are replaced by 12-bit signed immediate, imm[11:0] (in range [-2048, 2047]).

  • Remaining fields (rs1, funct3, rd, opcode) same as R-format.

  • Immediate is always sign-extended to 32-bits before use in an arithmetic operation.

I-immediate

Immediate generator generates I-type immediate

I-Format Arithmetic Instructions

I-Format Arithmetic Instructions

Adding I-Format arithmetic instructions to datapath

I-Format Load Instructions

Load instructions are also I-type.

Load Instruction Layout
  • Reg[rd] <- Mem[Reg[rs1] + offset]

    • The 12-bit immediate is added to the base address in rs1 to form the memory address

    • The value loaded from memory is stored in register rd

I-Format Load Instructions

Note that the funct3 field is to specify the width (i.e., the amount of bytes) and signedness of load data.

Adding load instructions to datapath

Last updated