Try it

Original

Step 1: flip every bit

Step 2: add 1 - two’s complement

Two's complement11101110
Signed check-18

Understand the result

What's going on

Computers don’t have a minus sign - everything is bits. Two’s complement is the trick that lets a fixed set of bits represent negative numbers too, using ordinary addition hardware with no special subtraction circuit needed.

The formula

two's complement = NOT(value) + 1

Show the derivation, mnemonic, and worked example

Build it up

Start from one’s complement - flip every bit - then add 1. That single extra step is what makes the arithmetic work out: adding a number to its two’s complement always produces all zeros (ignoring the overflow bit), which is exactly what you’d want from “a number plus its negative.” The top bit ends up doubling as a sign flag - 0 for positive, 1 for negative.

Worked example

Worked example

18 in 8-bit binary: 00010010

One's complement: 11101101

Two's complement: 11101110 (+1)

Read as signed 8-bit: −18 ✓