Computer Science I / Arithmetic at Machine Level
Practice question · True or false

Two's complement is used because it lets one adder circuit perform both addition and subtraction.

Hints
  1. How is a − b computed?
  2. Adding the negative gives the right answer with the same hardware.
Show the answer

True

Why

True. Negating in two's complement is invert-and-add-one, after which aba - b is just a+(b)a + (-b) through the same adder, with the carry out of the top bit discarded. Sign-magnitude would need separate subtract logic and has two zeroes; two's complement has one and wraps cleanly.

Read the lesson: Arithmetic at Machine Level →

Practise Arithmetic at Machine Level

The app has 7 more questions on this lesson, and keeps your place in the course. Computer Science I is free to start.

More questions on Arithmetic at Machine Level