next up previous
Next: Characters Up: Integers Previous: Table of Integer Representations

Sign Extension

When integers are expanded from a smaller to a larger representation, sign extension maintains the same value while changing the size of the representation.

Unsigned
Least significant bits are aligned. All bits not filled by the original integer are assigned 0.
Sign-Magnitude
The sign bit is placed in the leftmost bit of the larger representation. The least significant bit of the magnitude is aligned with the least significant bit of the larger representation. All bits not filled by the smaller representation are assigned 0.
Complement
Least significant bits are aligned. All bits to the left of the sign bit are assigned the same value as the sign bit.

Examples of conversions from 8 to 16 bits with sign extension:

tabular637



CS 301 Class Account
Mon Sep 13 11:15:41 ADT 1999