Assume an integer, x, which is encoded in two’s complement form in a w-bit word x, such that TMinw≤x≤TMaxw, then the unsigned integer represented by the bit vector x will be given by:
T2Uw(x)={x+2w,x,x<0x≥0
Visual representation
Conversion from unsigned to two’s complement
For an unsigned integer u such that 0≤u≤UMaxw represented by u, the corresponding two’s complement integer is given by: