Two's Complement
Today's standard for signed integers: negation by bitflip plus one, single zero.
Configure your inputs and press Compute to see the step-by-step computation.
How it works
Two's complement c2K,n is the de facto standard for signed types in modern CPUs. Zero has exactly one code (0...0), and patterns starting with 1 are always negative. Range: -2n-1 to 2n-1-1 (asymmetric: one more negative than positive). Negation by bitflip + 1. Addition runs as plain binary addition; on bit overflow the top bit is discarded (modulo 2n).
When to use
In C used by the signed types: signed char, short, int, long, long long. Practically all x86, ARM and RISC-V processors use two's complement.