Zum Inhalt springenSkip to content
Number Encodings

One's Complement

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

Configure your inputs and press Compute to see the step-by-step computation.

How it works

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

When to use

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.