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 remainder of unsigned division of rs1 by rs2. On division by zero, the remainder equals 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 selector chooses only specification-defined division-result branches; it is not an exception, 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.
Understand this scenario with real code like «remu a0, a1, a2 # a0 = a1 % a2 (unsigned)».
Understand this scenario with real code like «remu a0, a1, a2 # a0 = a1 % a2 (unsigned)».
REMU interprets both source registers as unsigned XLEN-bit integers. REM interprets them as signed integers, with a nonzero remainder following the dividend sign.