The concept of the minus symbol is very useful. Without it we could not perform subtraction, keep track of who owes money to whom, how many degrees it is below freezing and so on.
Negativity is a bit complicated in computing because there is no such thing as a minus symbol, there’s only ones and zeroes.
In our own decimal number system we can just put a – in front of a number. Our amazing brains know exactly what that means and what to do with it.
Take +42 (or just 42), the + isn’t really necessary because by default it’s a positive number. Adding a minus symbol is essential though if we need to show minus forty two -42.
Representing negative values in binary
42 in binary is 101010. When we want to show that this is a positive number, the equivalent of +42? Well, we don’t really need to do anything. The default state of a number is for it to be positive.
If we need to indicate the sign (+ or -) of a number in binary, where we can only use ones and zeroes then things become a bit tricky.
For positive numbers, we can add an additional 0 in front, this 0 does nothing to change the value of the number from it’s default positivity, but adding this anyway can be very useful.
How can we represent -42?
As we have seen, to specify that a binary value is positive, we can use 0 to represent the + symbol.
Can we do the same with 1 to represent the – symbol? Can we simply put a 1 in front of the 101010? No, not really because that would make 1101010, that is now 106 which is nothing remotely like 42 anymore!
The solution is to use a method called twos complement.
Twos complement
We use the binary number line as usual but with one key difference, the most significant bit (the one furthest to the left) is assigned a negative value.
Lets begin by considering the binary number line that we need to make the number 42.
32 | 16 | 8 | 4 | 2 | 1 |
1 | 0 | 1 | 0 | 1 | 0 |
To make the twos complement version of this number we need one more additional column and the value of that column increases by the power of two just as it usually would however it has a negative value!
-64 | 32 | 16 | 8 | 4 | 2 | 1 |
So to make -42, we now start with -64 and add the other values that we need to make 42…
-64 + 16 + 4 + 2 = -42!
-64 | 32 | 16 | 8 | 4 | 2 | 1 |
1 | 0 | 1 | 0 | 1 | 1 | 0 |
So, 1010110 is -42, we can carry out a quick check. If we add the values +42 and -42 together we should get zero as a result.

If a number is flagged as a twos complement number then the final carry bit is discarded (shown above in red) and so it can be seen that adding 42 and -42 in binary does indeed equal zero.
To convert a number into it’s twos complement form we can use the number line method as shown above but what if we want to convert a positive number that’s already in binary into twos complement?
We could convert it into decimal first and then use the number line method but that’s not very elegant and it’s not how a computer would do it.
Lets use 101010 (42) again. To convert this into twos complement first we can flip all the bits and then add 1.
Before we do that we need to add a zero in front to show that this is the + version of the number.
101010 as a + twos complement number is
0101010 next, swap the bits…
1010101 (inverting all the bits like this is called ones complement)
Next we add 1

1010101 + 1 = 1010110, and this is the twos complement of 0101010.
in summary we have looked at negative binary values, we’ve seen a method of converting negative decimal values into twos complement using the binary number line and we’ve also seen a method where we convert a + binary value into ones complement and then add 1.
This twos complement method is called a signed binary integer.