How this instrument works
Adding two numbers that fit in 4 bits (0 to 15 each) works exactly like ordinary addition, but the result can reach as high as 30 — far more than 4 bits can hold. Whenever the sum reaches 16 or beyond, it wraps around (drops back down by 16) and a carry-out flag switches on, the binary equivalent of decimal addition carrying into a new column once a sum reaches 10.
This is the identical carrying mechanic this site's Long Addition page demonstrates for ordinary base-10 digits, just relocated to base 2, where the overflow threshold is 16 (2⁴) instead of 10. The wrapped sum is then broken back down into its own four bits, the same conversion this site's Binary Calculator performs on any whole number.
This wraparound behavior matters well beyond a classroom exercise — it's exactly what happens inside real computer hardware when a fixed-width register overflows, and understanding it here in miniature makes that real-world overflow behavior far less mysterious.
- Enter the first number (0 to 15) into the First number field.
- Enter the second number (0 to 15) into the Second number field.
- Read Carry out: 1 means the true sum overflowed past 15.
- Read the four Sum bit fields — the wrapped 4-bit result, and add the carry back in mentally to recover the true total.
Worked example — 11 plus 7
11 (1011) plus 7 (0111) totals 18 in ordinary decimal arithmetic — too large for 4 bits, which max out at 15. The carry-out flag switches to 1, and the 4-bit result wraps around to 18−16=2 (0010), the same way a decimal odometer wraps from 99 back to 00 once it rolls past its own maximum.
5 (0101) plus 2 (0010) totals 7 (0111) with no overflow at all, since 7 fits comfortably within 4 bits. Pushed to the extreme, 15 (1111) plus 15 (1111) totals 30, wrapping to 30−16=14 (1110), with the carry flag switched on.
Questions
What does the carry-out flag mean?
It signals that the true sum of the two numbers exceeded what 4 bits can represent (15) — exactly the same signal ordinary decimal addition gives when a column's sum reaches 10 and a 1 needs to carry into the next place over.
Why does the result wrap around instead of just growing larger?
Because this page is deliberately scoped to a FIXED 4-bit width, mirroring how a real hardware register of fixed size behaves — once a sum exceeds that width's capacity, the extra amount is lost from view unless a wider register (or a carry flag, tracked separately) is used to catch it.
How is this related to the Long Addition page on this site?
Both demonstrate the identical carrying mechanic — a column's sum overflowing its own single-digit capacity — just applied to different bases: Long Addition overflows at 10 (decimal), while this page overflows at 16 (binary).
What's the largest possible sum this calculator can compute?
30, from adding the two largest possible 4-bit inputs, 15 and 15 — which wraps to 14 with the carry flag switched on, since 30 is 16 more than the 4-bit range can directly hold.
Does the order of the two numbers matter?
No — addition doesn't care about order, so swapping the two inputs always gives the identical sum, carry flag, and wrapped result.