The I-type (Immediate) instruction performs operations using one register and one immediate operand. The result of the operation is stored in the destination register rd. Figure 1 illustrates the instruction format for an I-type instruction, showing how the opcode, source register rs1, immediate value, and function fields are structured.

Figure 1: Instruction Format

Figure 1: Instruction Format

  • Opcode: The opcode or operation code is a 7-bit field that defines the type of operation to be performed on the data stored in the source registers.
  • Destination Register: Stores the result of the operation in the destination register rd.
  • Function Fields: This 3-bit funct3 field, known as the control bits, determines the specific operation to be executed.
    • Source Registers: A single source register rs1 of 5-bit field holds the address of the input operand.
  • Immediate Field: The immediate oprand used to I-type instruction.

Note: The immediate is 12-bit signed (two’s complement) number for all I-type instruction except immediate shit instructions (slli, srli, srai).

Below is table that describes the list of I-type instructions.

funct7funct3opcodeDescriptionInstruction
-0000000011 (3)load byte: signExt[7:0]lb rd, imm(rs1)
-0010000011 (3)load half: signExt[7:0]lh rd, imm(rs1)
-0100000011 (3)load word (31:0)lw rd, imm(rs1)
-1000000011 (3)load byte unsigned: zeroExt[7:0]lbu rd, imm(rs1)
-1010000011 (3)load half unsigned: zeroExt[15:0]lhu rd, imm(rs1)
-0000010011 (19)add immediate: signExtaddi rd, rs1, imm
00000000010010011 (19)shift left logical: signExtslli rd, rs1, imm
-0100010011 (19)set less than: signExtslti rd, rs1, imm
-0110010011 (19)set less than unsigned: signExtsltiu rd, rs1, imm
-1000010011 (19)xor immediate: signExtxori rd, rs1, imm
00000001010010011 (19)shift right logicalsrli rd, rs1, uimm
01000001010010011 (19)shift right arithmeticsrai rd, rs1, uimm
-1100010011 (19)or immediate: signExtori rd, rs1, imm
-1110010011 (19)and immediate: signExtandi rd, rs1, imm
-0001100111 (103)jump and link registerjalr rd, label