AGES 12+ · FREE · ENGLISH & HINDI
Your output: A checked binary conversion and a fixed-width addition trace.
Jump to a section
A bit is a choice between two symbols
A bit is a binary digit: 0 or 1. A physical system can represent those symbols using distinguishable states. In digital circuits, allowed voltage ranges represent the two values; a bit is not an individual electron. The representation lets us reason about information while electrical details remain underneath.
Source: MIT: the digital abstraction ↗
Eight bits make one byte. Use bit and byte carefully: 8 bytes contain 64 bits. A bit pattern does not announce what it means. The same stored bits may be interpreted as an unsigned number, a character code or part of an instruction according to the agreed encoding.
Source: NIST: bits, bytes and binary prefixes ↗ · MIT: representing information in bits ↗
Read binary using powers of two
Decimal place values grow by ten: 1, 10, 100. Binary place values grow by two: 1, 2, 4, 8, 16. Start at the rightmost bit with weight 1, then double the weight as you move left. Each bit contributes either its weight or zero. Write the order explicitly before adding.
Source: Harvard CS50: binary place values ↗
For 1101, calculate 1×8 + 1×4 + 0×2 + 1×1 = 13. Leading zeros do not change an unsigned value: 001101 also represents 13, but uses six bits instead of four. Position still matters: moving 1101 one place left to 11010 doubles its value to 26 when the extra position is retained.
To encode 13, choose the largest available weight, 8, leaving 5; choose 4, leaving 1; skip 2; choose 1. The choices are 1, 1, 0, 1. Decode the result again to check it. This is an arithmetic procedure, not a claim about how every processor performs conversion.
Count patterns before assigning values
Each extra bit doubles the number of possible patterns. With N bits there are 2ᴺ patterns. Assigning unsigned integers consecutively from zero uses the range 0 through 2ᴺ − 1. The number of values and the largest value differ by one because zero is included.
Source: MIT: binary representation and arithmetic ↗
| Bits | Patterns | Range |
|---|---|---|
| 4 | 16 | 0–15 |
| 8 · one byte | 256 | 0–255 |
| 12 | 4,096 | 0–4,095 |
These ranges assume unsigned integers. Signed representations use an agreed rule for negative values and have different ranges. Always state the width and interpretation before comparing or adding stored numbers. A longer display with extra leading zeros may preserve the value while changing the available future range.
The answer can need one more bit
Add 13 and 5: 1101 + 0101 = 10010, which is 18. A four-bit register has no fifth storage position. In our wrap-around model it keeps the lower four bits, 0010, and reports a carry of 1. The stored unsigned value is 2; the mathematical sum remains 18.
Keeping five bits would preserve 10010. This example specifies truncation; another design might widen, saturate or report an error. Do not assume every language or device automatically wraps in the same way. Unsigned carry and signed overflow also answer different questions.
Test the width as well as the sum
Put the model to work
Make a prediction, run one small check, and record the result and its limits. Explain a mismatch before changing several things at once.
Sources and further reading
- MIT: the digital abstraction ↗
- NIST: bits, bytes and binary prefixes ↗
- MIT: representing information in bits ↗
- Harvard CS50: binary place values ↗
- MIT: binary representation and arithmetic ↗
Original diagrams, examples and self-check questions. Each model states its assumptions; named source lessons provide further depth.
