Computer Science · Data representation · 20 suggested minutes
01 · Binary numbers and data representation
Learning objective: Convert unsigned binary values and explain bits and bytes.
A bit has two possible values, 0 or 1. An unsigned binary number uses powers of two as place values. In four bits these are 8, 4, 2 and 1. A byte contains eight bits. With n bits there are 2ⁿ distinct patterns; an unsigned n-bit integer ranges from 0 to 2ⁿ − 1.
The pattern 1010 represents ten when interpreted as an unsigned binary number. The same stored pattern can have a different meaning under a different encoding. Text requires a character encoding; images use representations of pixels and colour; sound can be sampled and quantised. A computer needs conventions, not merely flashing lights.
Adding binary numbers uses carrying just as decimal does, but each column carries at two rather than ten. A result outside the available number of bits causes overflow in a fixed-width unsigned representation. The virtual four-bit sender shows only unsigned place value; it does not implement encryption or all computer data types.
Worked example · follow the reasoning
1010₂ = 1×8 + 0×4 + 1×2 + 0×1 = 10. Eight bits provide 256 patterns, representing unsigned values 0–255.
Common misconception
Four bits represent sixteen different values, not a maximum unsigned value of sixteen.

