What is the core difference between REMU and REM?
REMU interprets both source registers as unsigned XLEN-bit integers. REM interprets them as signed integers, with a nonzero remainder following the dividend sign.
Unsigned remainder of rs1 / rs2, stored in rd
REMU provides the XLEN-bit unsigned remainder of rs1 divided by rs2. A zero divisor returns the dividend. Unsigned division cannot overflow.
Starts with machine-code field decoding, then shows operand reads, instruction-specific execution, and ISA-visible state update.
This example uses fixed initial register values and PC=0x2000; instruction fetch succeeds, with no asynchronous interrupt or extra extension checks. Exception branches stop ordinary commit; post-trap PC and handler state are EEI-dependent.
This selector chooses specification-defined division-result branches. Division presets set the displayed t1/t2 initial values; editing a source register restores normal mode. It is not a trap or performance model.
The machine code is split by the current instruction format; the animation starts from encoding/decode.
This animation shows ISA-visible decode and state changes, not any specific CPU pipeline, cache, prediction, or timing implementation.
REMU treats both rs1 and rs2 as XLEN-bit unsigned values, computes their remainder, and writes rd. Its unsigned interpretation differs from REM; the mnemonic change is semantic.
RV32/RV64 plus M, x6=20 and x7=7: remu x5, x6, x7 gives x5=6, interpreting both sources as XLEN-bit unsigned integers.
REMU interprets both source registers as unsigned XLEN-bit integers. REM interprets them as signed integers, with a nonzero remainder following the dividend sign.