<<< 2's complement integers     Index     Addition of two 2's complement integers >>>

9. Computing 2's complement example

  • To obtain 2's complement representation of decimal -13 (negative thirteen)

    1. Take representation of positive 13:

      • 01101

    2. Compute complement by flipping each bit:

      • 10010

    3. Add 1:

      • 10011 (decimal -13)

  • To go back from -13 to positive 13, execute the same exact steps:

    1. Take representation of negative 13:

      • 10011

    2. Invert each bit:

      • 01100

    3. Add 1:

      • 01101 (decimal 13)

<<< 2's complement integers     Index     Addition of two 2's complement integers >>>