Intuition The one idea behind everything
A computer has only two symbols, 0 and 1, and no wire that means "minus". Two's complement is the single trick of giving the top bit a negative weight so that the same adder circuit handles positive numbers, negative numbers, addition and subtraction — all at once.
Before you can use that trick, you have to be fluent in the little symbols the parent note throws around: bits, place-values, the bar x ˉ , the "mod" symbol, ⊕ , the subscripts on C . This page builds every one of them from nothing, in the order they depend on each other.
A bit is one switch that is either off (0) or on (1). That's the entire alphabet of a computer. There is no 2, no -, no . — only these two states.
Think of a light switch on a wall. Down = 0, up = 1. A number is a whole row of these switches. Everything else on this page is about agreeing on what a row of switches means .
Why the topic needs it: two's complement is a rule for reading a row of switches . If you don't picture the switch, the later symbols (b n − 1 , x ˉ ) have nothing to stand on.
b i and the index i
When we write b n − 1 b n − 2 … b 1 b 0 we are naming each switch. The little number below the b — its subscript i — is the position , counted from the right starting at 0. So b 0 is the rightmost switch, b 1 the next, and b n − 1 the leftmost.
Intuition Why start counting at 0, and why does position matter?
Look at the figure: the rightmost switch sits over the label 2 0 , the next over 2 1 , and so on. The subscript i is the exponent of 2 that switch controls. Naming positions this way is what lets us later say "the top switch b n − 1 is special" without ambiguity.
n = how many switches in the row (e.g. n = 8 for a byte).
b n − 1 = the leftmost switch — the parent note calls it the most significant bit (MSB) and gives it the negative weight.
b 0 = the rightmost switch — the least significant bit .
This is the foundation the whole topic sits on, so we build it slowly. See Binary number system for the unsigned home of this idea.
Definition Weight (place-value)
Each switch is worth a fixed amount. In ordinary binary the switch at position i is worth 2 i : that is 2 multiplied by itself i times (2 0 = 1 , 2 1 = 2 , 2 2 = 4 , 2 3 = 8 , … ). To read the number you add up the weights of the switches that are on .
Intuition Why powers of two and not something else?
With only two states per switch, each new switch on the left can be either off (adds nothing) or on (adds a fresh amount larger than everything to its right combined). Doubling each step is exactly the rule that makes "on = one bigger place" work with no overlaps. In the figure the on-switches (pale yellow) have their weights summed to give the value.
00000101
Only positions 2 and 0 are on: 4 + 1 = 5 . Nothing else contributes because those switches are off.
Why the topic needs it: the parent's master formula is just this weighted sum, with one weight made negative .
Definition Sigma / summation
∑
The big Greek "E", ∑ , means add up a list . The line ∑ i = 0 n − 2 b i 2 i reads: "let i walk from 0 to n − 2 ; for each i compute b i ⋅ 2 i ; add all those results." It is shorthand for a long + + + chain.
It's a for-loop over the switches . The bottom label (i = 0 ) says where to start, the top label (n − 2 ) says where to stop. Nothing mysterious — it just saves writing b 0 2 0 + b 1 2 1 + … every time.
Why the topic needs it: the definition
V = − b n − 1 ⋅ 2 n − 1 + ∑ i = 0 n − 2 b i ⋅ 2 i
uses ∑ to mean "the ordinary positive part (all switches except the top one)", then tacks on the top switch with a minus in front. Recognise the two pieces and the formula stops being scary.
Definition Signed weighting
In two's complement the top switch is worth − 2 n − 1 instead of + 2 n − 1 . Every other switch keeps its normal positive weight. So the value is (everything below) minus (the top switch's amount) .
Intuition Why one negative weight fixes everything
Look at the figure's number line. The lower switches can only build up to 2 n − 1 − 1 (all of them on). The top switch, when on, drags you down by the huge amount 2 n − 1 . So turning the top switch on flips you to the negative side . The single most-negative value − 2 n − 1 (only the top switch on) has no positive partner — that's the parent's "asymmetric range".
Top off, rest anything: values 0 to 2 n − 1 − 1 (the positives).
Top on: values − 2 n − 1 up to − 1 (the negatives).
Together: [ − 2 n − 1 , 2 n − 1 − 1 ] — one more negative than positive.
Why the topic needs it: this is the topic. Everything else (negation rule, discarding carries) is a consequence.
Definition Bitwise NOT, written
x ˉ
The bar over a bit-pattern means flip every switch : every 0 becomes 1 and every 1 becomes 0. This is the logic gate NOT applied to all switches at once. See One's complement , which is this flip with nothing added.
2 n − 1 and not 2 n ?
All-ones is the biggest n -bit pattern, and it is exactly one short of a clean 2 n (which would need an extra switch). This "one short" is precisely why the negation rule needs the "+1". Hold onto that.
Why the topic needs it: the parent derives − x = x ˉ + 1 straight from this identity. No bar, no negation rule.
2 n
"A ≡ B ( mod 2 n ) " means ==A and B leave the same remainder when you take away as many whole 2 n 's as you can==. On an n -bit machine, values that differ by exactly 2 n look identical , because the difference falls off the top and there's no switch to hold it. See Modular arithmetic .
Intuition The odometer / clock picture
The figure is a circle of 2 n positions. Counting up past the top wraps back to 0; counting down from 0 wraps to all-ones. So 2 n and 0 are the same point , and 2 n − x sits at the same place as − x . That is the whole reason a negative number can be stored with no minus sign: we just walk the other way around the circle.
Why the topic needs it:
It explains why 2 n − x ≡ − x (so x ˉ + 1 really is the negative).
It explains why you discard the carry-out : the carry is worth 2 n ≡ 0 , so throwing it away changes nothing.
⊕
⊕ means exclusive OR : the result is 1 when the two inputs differ , 0 when they match. So 1 ⊕ 0 = 1 and 1 ⊕ 1 = 0 .
Definition Carry into / out of the MSB
When adding column by column (like a Full adder chain), each column can send a spillover 1 into the next column — a carry . C n − 1 is the carry that arrives into the top column; C n is the carry that leaves out of the top column. The subscript is just the position the carry is crossing.
Intuition Why compare these two carries?
If the same amount of carry flows in and out of the top column, the sign came out honestly. If they disagree (C n − 1 ⊕ C n = 1 ), the negative-weighted top switch got flipped by a spillover it shouldn't have — the true answer didn't fit in the range. That mismatch is signed overflow. Full detail lives in Overflow and carry flags .
Why the topic needs it: this is the only extra symbol needed for the overflow rule Overflow = C n − 1 ⊕ C n .
Position and subscript b_i
Summation adds weighted bits
Identity x plus not x = 2^n minus 1
Negation rule not x plus 1
Test yourself — you're ready for the parent note when you can answer each without peeking.
What does a single bit represent, physically? One switch that is either off (0) or on (1) — the only alphabet a computer has.
In b n − 1 … b 0 , which switch is b 0 and which is b n − 1 ? b 0 is the rightmost (least significant); b n − 1 is the leftmost (most significant / MSB).
What is the weight of the switch at position i in ordinary binary? 2 i — each step left doubles the value.
What does ∑ i = 0 n − 2 b i 2 i mean in plain words? Add up the weighted value of every switch except the top one.
What is different about the MSB's weight in two's complement? It is − 2 n − 1 (negative) instead of + 2 n − 1 .
What does the bar in x ˉ do? Flips every bit: 0↔1 (bitwise NOT).
What does x + x ˉ always equal, and why? 2 n − 1 (all ones), because every column has one 0 and one 1.
What does A ≡ B ( mod 2 n ) mean on an n -bit machine? A and B differ by a whole number of 2 n 's, so they look identical (the difference falls off the top).
Why can you discard the carry-out in signed addition? It is worth 2 n , and 2 n ≡ 0 ( mod 2 n ) , so dropping it changes nothing.
What does C n − 1 ⊕ C n = 1 signal? Carry into the MSB differs from carry out of it → signed overflow.