RV32I-Lite Encoder / Decoder

Mnemonic in, 32-bit fields out, and the reverse. Companion worksheet →

What this is for

The S-format and B-format immediates are split: their bits do not appear contiguously in the 32-bit word, so that rs1 and rs2 stay in the same place across every format. Load sw x6, 12(x2) and watch where imm[11:5] and imm[4:0] land. Load beq x5, x0, 8 and watch the B-format shuffle. Fields are color-coded: opcode, rd, funct3, rs1/rs2, funct7, immediate.

Encode

Decode