What value does SLTI write?
It writes 1 when the comparison is true, otherwise 0.
Set rd to 1 if rs1 is less than the immediate (signed), else 0
SLTI uses opcode 0010011 (0x13), funct3 010. The rs1 field selects the source register, the 12-bit immediate provides the second operand, and rd selects the destination.
SLTI (signed) compares rs1 with the sign-extended 12-bit immediate, setting rd to 1 if rs1 < imm (signed), else 0. Used for single-step comparison and range checking in loops.
SLTI performs signed comparison rs1 < imm; rd is set to 1 when true and 0 otherwise. It turns a comparison result into an integer value usable by later arithmetic or branches.
Understand this scenario with real code like «slti x5, x6, 10 # x5 = (x6 < 10) ? 1 : 0 (signed)».
It writes 1 when the comparison is true, otherwise 0.
SLT/SLTI compare as signed integers; SLTU/SLTIU compare as unsigned integers.