### CIE IGCSE Computer Science (0984/0478)

1 - Data Representation
1.1 Number Systems
1.2 Text, Sound, & Images
2 - Data Transmission
3 - Hardware
3.1 Computer Architectures
3.3 Data Storage
3.4 Network Hardware
4 - Software
5 - The Internet & Its Uses
5.3 Cyber Security
6 - Automated and emerging technologies
7 - Algorithms
7 Algorithms
1 of 2

# Representing Negative Binary Numbers

Data Representation is a large topic within Computer Science and extends further than simply understanding what binary is and how to convert it. Binary is the representation of the language that your computer speaks – in fact, instead of 1s and 0s your computer uses a pattern of on and off electrical signals that it can then translate into numbers.

Although representing basic positive numbers is important to learn, understanding that negative numbers exist and must have a way of being represented in a computer is equalluy important.

So, how can a computer represent a negative sign when you can only use 1s & 0s?

Even though negative numbers is considered a “tough” topic, don’t worry too much about it being really difficult as there’s a simple trick to creating a negative binary number that will work every time!

## Two’s Complement

Representing negative numbers in binary requires us to identify the sign that is used in front of the number. You will already be familiar with using a sign for negative numbers in maths as if the number is negative then a minus sign is placed before it. a signed integer is simply a whole number that is identified as either positive or negative and can be either.

The instructions below are a handy reference to how we create a negative number in Two’s Complement:

There are several ways in which to convert from denary into a negative Two’s Complement format. However, one particular way is very useful for the exam as it does not rely on a brute force technique and makes use of your prior understanding of how to create a positive binary number. Following the steps in the algorithm below we can transform a positive number into a negative number using the Two’s Complement method:

• set up the columns with the most significant bit as a minus number
• convert the positive version of the number into its fixed point binary format
• identify the least significant one
• retain the same numbers for the least significant one and any trailing zeros
• flip all other digits towards the most significant figure

Of course, don’t trust me and just use my example! Take any negative integer and test this theory out for yourself.