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.2 Subtraction

As I indicated at the start of this section, subtraction is converted to addition by replacing the number to be subtracted by its additive inverse, which in the case of binary arithmetic is its 2's complement. An example should make this clear.

Example 9

Subtract the signed integer 1010 1010 from the signed integer 0001 0110.

Answer

The additive inverse of the number to be subtracted, 1010 1010, is 0101 0101 + 1 = 0101 0110. Using this additive inverse transforms the computation to an addition:

(Check: 1010 1010 is −86 and 0001 0110 is 22, so the calculation is 22 − (−86), which is 108, and 0110 1100 is indeed 108.)

Activity 25 (Self assessment)

Carry out the following subtraction by first finding the additive inverse of the number to be subtracted:

1100 1010 − 0000 1110

Answer

The additive inverse of the integer to be subtracted is its complement plus 1:

1111 0001 + 0000 0001

which is 1111 0010.

So the calculation is now:

The ninth bit can be ignored here, as mentioned in Section 7.2. So the result is 1011 1100.

T224_2

Take your learning further371

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 courses372.

If you are new to university level study, we offer two introductory routes to our qualifications. Find out Where to take your learning next?373 You could either choose to start with an Access courses374or an open box module, which allows you to count your previous learning towards an Open University qualification.

Not ready for University study then browse over 1000 free courses on OpenLearn375 and sign up to our newsletter376 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