Mr Goff logo

Computer Science

Two's compliment binary to denary

Two's compliment as we have seen can be used to represent negative numbers in binary.

Example

The easiest way to work out the denary value of a two's compliment binary number is simply to add all the column headings where the column contains a 1 just like with normal numbers.

-128 + 32 + 8 + 4 = -84

-128 64 32 16 8 4 2 1 Total
1 0 1 0 1 1 0 0 -84

Practice

Click the button below to generate a number to convert to two's compliment binary.

-128 64 32 16 8 4 2 1 Total
0 0 0 0 0 0 0 0



Two's compliment binary to denary using the flip the bits method

You should also be aware of this other method. This involves flipping the bits, adding one and converting the number to its denary equivalent.

Action -128 64 32 16 8 4 2 1 Total
two's comp 1 1 0 1 0 0 1 0 -46
flip 0 0 1 0 1 1 0 1
add 1 0 0 1 0 1 1 1 0 46

Computer Science Home