GCSE Link: 3.02 (Binary and Hexadecimal)

On this page we will learn about representing negative integers in binary.

There are many methods for storing negative integers in binary, but the only one you need to know about is called two's complement.

Two's complement is a method of representing signed (positive, negative, or zero) integers in binary.

It uses the most significant (left-most) bit to represent the sign, with a 0 representing positive, and a 1 representing negative. The rest of the bits encode the magnitude of the number.

All non-negative integers are represented exactly like in unsigned binary systems, except with a leading 0 for the sign. For example, the number 5 would be 0101 in a 4-bit signed system.

Note that because the left-most bit is being used for the sign, the maximum value that can be represented in a 4-bit signed system is 7 (0111).


For negative integers, however, we follow a different process. Here's what it would look like for the number -5 in a 4-bit signed system.

Therefore, -5 would be represented as 1011 in a 4-bit signed system.

The lowest value that can be represented in a 4-bit signed system is -8. Remember that the lower bound will always be even, and the upper bound will always be odd.



How would the number -69 be represented in an 8-bit signed system?

First, write the representation of +69, which is 0100 0101. Next, flip all the bits: 1011 1010. Finally, add 1 to the binary representation to get 1011 1011.