Conversion from two’s complement to unsigned

  • Assume an integer, , which is encoded in two’s complement form in a -bit word , such that , then the unsigned integer represented by the bit vector will be given by:

Visual representation

Conversion from unsigned to two’s complement

  • For an unsigned integer such that represented by , the corresponding two’s complement integer is given by:

Visual representation

Sources