Computers use the binary (base-2) number system because electronic components have two states: on (1) and off (0). These are called bits. Every piece of data in a computer — numbers, text, images, sound — is ultimately stored as binary.
Binary uses powers of 2. Each column represents a power of 2, doubling in value from right to left:
| Bit position | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|
| Place value (2ⁿ) | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
To convert binary to denary, write the binary digits under their place values and add up the values where there is a 1.
Example: Convert 10110101 to denary
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|
| 1 | 0 | 1 | 1 | 0 | 1 | 0 | 1 |
128 + 32 + 16 + 4 + 1 = 181
To convert denary to binary, subtract the largest possible power of 2 from the number, write 1 in that column, and repeat until the number reaches 0. Write 0 in all unused columns.
Example: Convert 147 to binary
Result: 10010011
Check: 128 + 16 + 2 + 1 = 147 ✓
| Term | Number of bits | Example |
|---|---|---|
| Bit | 1 | 0 or 1 |
| Nibble | 4 | 1010 |
| Byte | 8 | 10110101 |
An 8-bit (1 byte) unsigned binary number can represent values from 0 to 255 (2⁸ − 1).
5 questions · Edexcel 4CP0 specific
Timed test · 4 questions · Edexcel mark scheme