One's complement adder

1k views Asked by At

I am not sure this is the proper section of the forum, in case please just let me know.

I am studying Computer Organization and Design, and the legendary Patterson & Hannessy states that "One's complement adders did need an extra step to subtract a number and hence two's complements dominates today".

What is the extra operation that does an one's complement require?

1

There are 1 answers

0
melpomene On BEST ANSWER

The two's complement adder just straight up adds two numbers, bit by bit. The clever bit is that negative numbers are represented in such a way that signed and unsigned addition use exactly the same algorithm, whereas with one's complement you need a runtime check in the signed adder (negative inputs need an extra +1).

In other words, when you're doing 5 + -2 on a 4-bit adder, the two's complement adder gets 0101 and 1110 as inputs and it doesn't need to care whether 1110 represents -2 or 14.