signextended
Signextended refers to the process of enlarging the width of a signed integer by replicating its sign bit into all higher-order bits. In two's complement representation, this preserves the numeric value when promoting from a smaller width to a larger width. If the original value's most significant bit is 0, the new bits are filled with 0s; if it is 1, the new bits are filled with 1s.
Common cases include sign-extending an 8-bit value to 16, 32, or 64 bits, or sign-extending a 16-bit
Sign extension is the counterpart of zero extension, which fills new higher-order bits with zeros regardless
Hardware and software implementations provide mechanisms for sign extension. Some CPUs offer dedicated instructions for sign-extending
See also: sign extension, two's complement, sign bit, type promotion.