rd, rs1, rs2rd = (rs1 < rs2) ? 1 : 0sltu compares two numbers and sets the destination register to 1 or 0, exactly like slt — but it reads the values as unsigned. The name is set less than, unsigned. If the idea of storing a comparison as a 1-or-0 result is new, the slt page introduces it.
The word unsigned is the entire difference, and it changes answers. The same 32 bits can be read as a signed number (top bit means negative, range roughly -2 to +2 billion) or as an unsigned one (no negatives, range 0 to about 4 billion). slt uses the signed reading; sltu uses the unsigned one. A register whose bits are all 1s is -1 to slt but the largest possible value to sltu, so the two can give opposite verdicts on identical inputs.
Use sltu for quantities that genuinely cannot be negative: memory addresses, sizes, counts, positions. Comparing two memory addresses with the signed slt is a classic hidden bug — the moment an address is large enough to set its top bit, signed comparison mistakes it for a negative number and flips the result.
The form is sltu rd, rs1, rs2. A useful special case: sltu rd, zero, rs sets rd to 1 whenever rs is anything other than zero, since 0 is unsigned-less-than every other value — a quick way to collapse any number to a clean 1-or-0.