2’s complement is the dominant representation for signed binary integers in modern hardware. To negate a number, invert every bit and add . The same adder circuit handles addition and subtraction across all sign combinations — no special cases, no end-around carry.

For an -bit number , the 2’s complement is . Equivalently, the 1’s complement plus one. See Radix Complement for the general theory; 2’s complement is the radix complement in base .

Examples for 8-bit:

  • (invert all bits → , add 1 → )

The MSB still indicates sign — for positive, for negative — but it also carries place value. In an -bit 2’s complement number, the MSB contributes rather than . So the value of is

Range for bits: to — asymmetric, with one more negative value than positive.

Why it wins

Three properties make 2’s complement the obvious choice:

  1. One zero. is the only zero — no vs. ambiguity.
  2. Standard addition for all sign combinations. Just add the bits including the sign positions, and discard any carry out of the MSB. The result is correct.
  3. Same hardware as unsigned addition. A 2’s complement adder is electrically identical to an unsigned adder — only the interpretation of the bits differs.

Addition

No special cases. Add the bits, throw away the carry out of the MSB:

If those operands are and , the result is the 2’s complement representation of . Verify: invert and add 1 → , so . ✓

Subtraction

Subtract by adding the 2’s complement of the subtrahend:

Discard the MSB carry; result is .

Implementation: adder/subtractor

A 2’s complement adder/subtractor uses one adder plus a row of XOR gates controlled by a Sub bit. The -bit operand feeds the adder’s inputs directly; operand feeds through XOR gates whose other input is the shared Sub line, with the XOR outputs feeding the adder’s inputs; Sub also feeds the adder’s carry-in.

When Sub : the XORs pass through unchanged, , and the circuit computes .

When Sub : the XORs invert , and Sub also feeds . The result is .

The XOR-with-control-bit pattern is exactly the “controlled inverter” use of XOR. Combined with the adder, you get an addition/subtraction unit at minimal extra hardware cost.

Overflow

Adding two same-signed 2’s complement numbers can give a result whose sign bit doesn’t match — the value overflowed the representable range. See Overflow (binary arithmetic).

Quick conversion

To negate a 2’s complement number by hand:

  1. Find the rightmost in the bit pattern.
  2. Leave it and everything to its right unchanged.
  3. Invert everything to its left.

Example: negate . Rightmost is at bit 2. Leave bits 0–2 () alone, invert bits 3–7 (). Result: . Check: and . ✓