What value does SLT write?
It writes 1 when the comparison is true, otherwise 0.
Set rd to 1 if rs1 is less than rs2 (signed), else 0
SLT uses opcode 0110011 (0x33), funct3 010, funct7 0000000. The rs1 and rs2 fields select the two source registers, and rd selects the destination register.
SLT (R-type) compares rs1 and rs2 as signed integers, setting rd to 1 if rs1 < rs2, else 0. funct7=0000000, funct3=010. Produces a boolean result, used to implement signed comparison logic and branch condition preparation. SLT + BNE can implement any conditional branch.
SLT performs signed comparison rs1 < rs2; 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 «slt x5, x6, x7 # x5 = (x6 < x7) ? 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.