Skip to content
Mermaid templates

RISC-V Instruction Formats

R / I / S / B / U / J formats laid out as bit-fields.

Template previewMermaid
Rendering…

Make it your own.

block-beta
columns 6
  R["R-type"]:1 R1["funct7 [31:25]"]:1 R2["rs2 [24:20]"]:1 R3["rs1 [19:15]"]:1 R4["funct3 [14:12]"]:1 R5["rd / opcode"]:1
  I["I-type"]:1 I1["imm[11:0]"]:2 I2["rs1"]:1 I3["funct3"]:1 I4["rd / opcode"]:1
  S["S-type"]:1 S1["imm[11:5]"]:1 S2["rs2"]:1 S3["rs1"]:1 S4["funct3"]:1 S5["imm[4:0] / opcode"]:1
  B["B-type"]:1 B1["imm[12,10:5]"]:1 B2["rs2"]:1 B3["rs1"]:1 B4["funct3"]:1 B5["imm[4:1,11] / opcode"]:1
  U["U-type"]:1 U1["imm[31:12]"]:4 U2["rd / opcode"]:1
  J["J-type"]:1 J1["imm[20,10:1,11,19:12]"]:4 J2["rd / opcode"]:1
classDef hd fill:#1e3a8a,color:#fff;
classDef f1 fill:#dbeafe;
classDef f2 fill:#dcfce7;
classDef f3 fill:#fef3c7;
class R,I,S,B,U,J hd
class R1,I1,S1,B1,U1,J1 f1
class R2,I2,S2,B2 f2
class R3,S3,B3 f3