Representing and manipulating data in computers
Representing and manipulating data in computers

Start this free course now. Just create an account and sign in. Enrol and complete the course for a free statement of participation or digital badge if available.

Free course

Representing and manipulating data in computers

7.3 Subtracting 2's complement integers

You will probably have carried out subtraction of denary numbers using rules for subtraction that include the process of ‘borrowing’ whenever you need to subtract a larger digit from a smaller one. It is possible to perform binary subtraction in a very similar way, but that is not what happens in computers. The processor contains the circuits needed to perform addition, and it is much more efficient to use these circuits also to perform subtraction than it is to build in extra circuits to perform subtraction.

But how can subtraction be converted into addition? The answer is by first converting the number to be subtracted into its additive inverse. For example, the denary subtraction

7 − 5

can be converted into addition provided the additive inverse of 5 is used. As I mentioned in Section 3.4, the additive inverse of 5 is −5, and so the equivalent addition is

7 + (−5)

In 2's complement binary arithmetic, the additive inverse of a number is known as its 2's complement. I'll start, therefore, by showing you how to find the 2's complement of any binary number.


Take your learning further

Making the decision to study can be a big step, which is why you'll want a trusted University. The Open University has 50 years’ experience delivering flexible learning and 170,000 students are studying with us right now. Take a look at all Open University courses.

If you are new to University-level study, we offer two introductory routes to our qualifications. You could either choose to start with an Access module, or a module which allows you to count your previous learning towards an Open University qualification. Read our guide on Where to take your learning next for more information.

Not ready for formal University study? Then browse over 1000 free courses on OpenLearn and sign up to our newsletter to hear about new free courses as they are released.

Every year, thousands of students decide to study with The Open University. With over 120 qualifications, we’ve got the right course for you.

Request an Open University prospectus371