ONES' COMPLEMENT negate by flipping every bit — and a carry that wraps around the end
Before two's complement won, machines negated a number by flipping every bit: ¬x, the ones' complement. It is beautifully symmetric — negation is a pure bit-flip, an involution (¬¬x = x) — but it has two costs: two zeros (0000 and 1111, +0 and −0) and the end-around carry: when you add ones'-complement numbers, the carry out of the top must be wrapped back into the bottom (dart 385). That awkward wrap is why two's complement (one zero, no wrap) replaced it — but the internet still runs on it: the TCP/IP checksum is ones'-complement sum.
THE TECHNIQUE negate = flip all bits (¬x); ¬¬x = x ; two zeros; end-around carry
The demo takes the 4-bit ones' complement of 5 (→ 10) — a pure bit-flip, and its own inverse: live demo
HISTORY & CREDIT early computers · CDC, PDP-1
“Negation needs arithmetic.” — ones' complement negates by flipping bits, and flipping twice returns the number: negation as a pure involution. The cost is two zeros and a wrapping carry. cited
the flip · ¬x = negation; an involution, ¬¬x=x. the costs · +0 and −0 (two zeros); the end-around carry on addition. still used · the TCP/IP checksum is a ones'-complement sum — the wrap is a feature there.
Flip every bit to negate, flip again to return — symmetric, but two zeros and a carry that wraps. The elegant loser, alive in every packet. ones' complement
RECOMMEND FOR I-13 the bit-flip negation, on the compiler
On the canonical compiler, the 4-bit ones' complement of 5 is 10 (15−5), and 5+10=15 (all ones = −0):
$ i13 run c_onescomplement.i13 # ~x in 4 bits = 15 - x
RUN OK · 10 step(s) · peak stack 2 · call depth 0
comp = 10 -- ones' complement of 5 (flip all 4 bits)
check = 15 -- 5 + 10 = 1111 = -0 (the two-zeros cost)
Recommend: ones' complement is negation as a pure flip — an involution, ¬¬x=x — and i13 flips 5→10. Not a keeper (the bit-flip is self-inverse, exactly the CRC/Verlet axis the corpus already holds; and the end-around carry is a resource wrinkle). The dart that shows the carry can wrap the world — and that the loser of the negation wars still checksums the internet.