B-type
B-Format Instruction Layout

B-format is similar to S-format, with two register sources (rs1/rs2) and a 12-bit immediate
The 12 immediate bits encode 13-bit signed byte offsets (low bit of offset is always zero, so no need to store it)
But now immediate represents values
-2^12
to+2^12 - 1
in 2-byte increments
Encoding Example

Immediate Encoding (So Far)

Adding Branches to Datapath

Branch Comparator

All RISC-V Branch Instructions

Last updated