*** Welcome to piglix ***

Adder–subtractor


In digital circuits, an adder–subtractor is a circuit that is capable of adding or subtracting numbers (in particular, binary). Below is a circuit that does adding or subtracting depending on a control signal. It is also possible to construct a circuit that performs both addition and subtraction at the same time.

Having an n-bit adder for and , then . Then, assume the numbers are in two's complement. Then to perform , two's complement theory says to invert each bit with a NOT gate then add one. This yields , which is easy to do with a slightly modified adder.


...
Wikipedia

...