How this instrument works
Two's complement is the standard scheme computers use to represent negative numbers in binary: it's found by taking the one's complement (flipping every bit, covered on this site's own separate page) and then adding 1. Computed directly for a 4-bit number, that two-step process simplifies to one subtraction: 16 minus the number, wrapped back into the 4-bit range.
The value of two's complement shows up in what happens when a number and its two's complement are added together: the sum always wraps around to exactly 0 within the fixed bit width, since 5+11 totals 16, which reads as 0 once it overflows a 4-bit register — exactly the behavior a genuine −5 would need to have alongside a genuine 5.
Unlike one's complement, which represents zero two different ways, two's complement gives zero exactly one representation (0000), which is the main reason it replaced one's complement as the standard approach in virtually every modern computer.
- Enter a 4-bit number (0 to 15) into the 4-bit number field.
- Read Two's complement: 16 minus the number, wrapped into the 4-bit range.
- Add the original number and its two's complement together and confirm the sum wraps around to exactly 0.
Worked example — complementing 5
5's two's complement is 16−5=11 — standing in for −5 within a 4-bit signed system. Adding 5 and 11 together gives 16, which wraps around to 0 in 4-bit arithmetic, exactly the behavior 5+(−5)=0 should have.
0's two's complement is 0 itself, since (16−0) mod 16 wraps back to 0 — the one number that represents its own negative, matching −0=0. 8's two's complement is also 8, the midpoint of the 4-bit range, a boundary case in signed binary representation where a number complements to itself.
Questions
What is two's complement used for?
Representing negative numbers in binary — it's the standard signed-number encoding used inside virtually every modern computer, letting ordinary binary addition handle both positive and negative values without any special-case circuitry.
How do you find a number's two's complement?
Flip every bit (its one's complement) and add 1 — for a 4-bit number, that two-step process is arithmetically the same as computing 16 minus the number directly.
How is two's complement different from one's complement?
One's complement simply flips every bit; two's complement flips every bit and then adds 1, a small extra step that gives zero exactly one representation instead of one's complement's two.
Why does adding a number to its own two's complement give 0?
Because the two values are specifically constructed to sum to exactly 16 (2⁴), which wraps around to 0 once it overflows a 4-bit register — the arithmetic signature that makes two's complement behave like a genuine negative number under ordinary addition.
What is special about the two's complement of 8 in a 4-bit system?
It complements to itself — 8 sits at the exact midpoint of the 4-bit range, a boundary value where the standard positive/negative split becomes ambiguous, a well-known edge case in fixed-width signed binary systems.