What is Sign extension?

Widening a signed integer to more bits by copying its top (sign) bit into all the new upper bits, which preserves its value. Filling the upper bits with zeros is zero extension.

Field: ISA & Assembly

Sign extension in the explanations

Questions that mention Sign extension (2)

  1. On RISC-V RV32I, what 32-bit value is in t0 after "addi t0, zero, -1"?
  2. A byte in memory holds 0x80. Which pair correctly gives the 32-bit register value after loading it with RISC-V lb and with lbu?

Related terms

Two's complement Addressing mode Application binary interface (ABI) Assembler Branch delay slot Callee-saved register Caller-saved register Calling convention Compressed instruction Condition code

Back to the glossary