Addsubtract
Addsubtract is a term used to describe a dual-function arithmetic capability in digital logic and computing, where a single unit can perform either addition or subtraction on binary numbers. In practice, addsubtract is often implemented as an add-subtractor within an arithmetic logic unit (ALU), controlled by a mode signal that selects the operation.
A common hardware realization uses a standard binary adder with the second operand inverted when subtraction
For unsigned arithmetic, the carry-out of the addition indicates a result that wraps around. For signed arithmetic
Addsubtract capabilities are central to many processors’ ALUs and are also found in scientific calculators and
Arithmetic logic unit, Two’s complement, Overflow detection, Adder-subtractor.