Binary numbers
SOF ICSO · Computer Science · about 7 minutes
Computers store everything as 0s and 1s. Each binary place is worth double the one to its right: 1, 2, 4, 8, 16, 32, 64, 128.
Flip the switches and watch the decimal value; press Count up to see binary counting.
Place values that double
In decimal each place is worth 10 times the one to its right: ones, tens, hundreds. In binary each place is worth 2 times: 1, 2, 4, 8, 16, 32, 64, 128. A binary digit (bit) is 0 or 1.
So 1011 in binary is 8 + 0 + 2 + 1 = 11.
Decimal to binary
Divide by 2 again and again and write down the remainders; read them from the bottom up. 13 ÷ 2 = 6 r 1, 6 ÷ 2 = 3 r 0, 3 ÷ 2 = 1 r 1, 1 ÷ 2 = 0 r 1, so 13 = 1101.
Or subtract the biggest power of 2 that fits: 13 = 8 + 4 + 1.
Bits, bytes and other bases
8 bits make a byte, which can hold 2⁸ = 256 values (0 to 255). n bits give 2ⁿ patterns.
Hexadecimal groups 4 bits into one digit 0–9, A–F: 1111 = F = 15, so 1111 1111 = FF = 255. Octal groups 3 bits.
Worked examples
Example 1Convert 45 to binary.
- 45 = 32 + 8 + 4 + 1.
- Places 32, 16, 8, 4, 2, 1 → 1, 0, 1, 1, 0, 1.
Answer: 101101
Example 2Add 1011 and 0110 in binary.
- 11 + 6 = 17 in decimal.
- 17 = 16 + 1 = 10001.
Answer: 10001
Where marks are lost
- Reading the remainders top to bottom instead of bottom to top.
- Forgetting that 1 + 1 = 10 in binary (write 0, carry 1).
- Thinking a byte holds values up to 256: it is 0 to 255.
Exam tips
- To convert to binary, keep dividing by 2 and read the remainders bottom-up.
- 8 bits = 1 byte; 1 kilobyte ≈ 1,000 bytes.
- Hexadecimal uses 0–9 and A–F: one hex digit is four bits.
Practice questions
What is 1011 in binary as a decimal number?
What is 20 in binary?
How many bits are in a byte?
More worked examples
Try each one first, then open the working.
Add the two binary numbers. What is the answer in decimal?
Show the working
Start: Change each to decimal, or add column by column with carries.
1100100 = 100, 110011 = 51; sum 151 = 10010111₂.
Answer: 151
The byte 00111011 is a signed number in two’s complement. What is its value in decimal?
Show the working
Start: If the first bit is 1, subtract 256.
Leading 0 means positive: 59.
Answer: 59
What is the hexadecimal number 9A9 in decimal?
Show the working
Start: Each place is worth 16 times the next.
9×16^2 + A×16^1 + 9×16^0 = 2473.
Answer: 2473
What is this byte in decimal?
Show the working
Start: Each box is worth double the one to its right.
Add the place values with a 1: 16 + 1 = 17.
Answer: 17
Practise more
New questions every time, at exam level
Add the two binary numbers. What is the answer in decimal?