# Ones' complement visualised: negation by bit flip

> Interactive n-bit ones' complement: negation by flipping all bits, double zero, a range symmetric around zero, −127 to 127 with 8 bits.

Address: https://marckimmel.de/en/informatik/zahlenkodierungen/einerkomplement
Deutsche Fassung: https://marckimmel.de/informatik/zahlenkodierungen/einerkomplement.md

Extends binary encoding with negative numbers: negation by flipping all bits.

One's complement c_(1K,n) splits the 2^n bit patterns into two halves: with leading 0 the number is nonnegative, with leading 1 it is nonpositive. Negation is exactly the bitflip. Range: -(2^(n-1)-1) to 2^(n-1)-1. Pitfall: zero has two codes (0...0 and 1...1). Addition needs a correction (+1 on bit overflow).

Historically in early mainframes (PDP-1, UNIVAC 1100). No longer used today but useful as a teaching tool and as the conceptual step toward two's complement.

## Related

- [Number Encodings](https://marckimmel.de/en/informatik/zahlenkodierungen.md)
