An adder-subtractor is a combinational logic circuit built from full adders and XOR gates that can toggle between adding or subtracting two binary inputs based on a control signal. When subtracting, it typically uses two's complement arithmetic by inverting one of the operands and adding a one to the carry-in bit. It forms the fundamental building block of an arithmetic logic unit (ALU) in microprocessors.
Tie the mode control pin of the adder-subtractor to the instruction decoder so it knows when to invert the B input.
Related terms
Full adder
A digital logic circuit that adds three single-bit binary numbers and outputs a sum and a carry bit.
Half adder
A digital logic circuit that adds two single-bit binary numbers and produces a sum and a carry output.
Arithmetic logic unit
The digital circuit block inside a processor that performs integer math and bitwise operations.
Combinational logic
A type of digital logic where outputs are determined entirely by the present combination of inputs.