kasim-lone.dev — data-representation / binary
← All topics

GCSE · Data Representation

Topic 2
Binary

Scroll to begin ↓

By the end you'll be able to…

  • Explain the difference between denary (base-10) and binary (base-2).
  • Convert an 8-bit number from denary → binary and back.
  • Add two 8-bit binary numbers together and spot an overflow error.
  • Perform a left or right binary shift and describe its effect.

Denary (Base-10)

Denary is the number system we use every day. It has 10 digits (0–9). Each column has a place value that increases by a factor of 10 as you move left.

1000s100s10s1s
103102101100
3268

Reading left to right: (3 × 1000) + (2 × 100) + (6 × 10) + (8 × 1) = 3268.

Binary (Base-2)

Binary has only 2 digits (0 and 1). Each column has a place value that doubles as you move left.

1286432168421
2726252423222120
💡 Memorise these 8 numbers

128, 64, 32, 16, 8, 4, 2, 1. If you can write these out fast at the start of the exam, every conversion becomes easy.

🖱️ Try it: click the bits

Click any bit to flip it on/off. Watch the denary value update instantly.

1280
640
320
160
80
40
20
10
Binary: 00000000 Denary: 0
💡 Range for 8 bits

With 8 bits you can represent 0 to 255 (0000 0000 to 1111 1111). At GCSE you'll only ever be asked to work with 8 bits.

Converting denary to binary

The reliable method: write out the place values, then walk left → right, deciding "does this fit?" at each column.

✏️ Example — convert denary 45
  1. Write the place values: 128, 64, 32, 16, 8, 4, 2, 1.
  2. Does 128 fit into 45? No → 0. Does 64? No → 0. Does 32? Yes → 1. Subtract: 45 − 32 = 13.
  3. Does 16 fit into 13? No → 0. Does 8? Yes → 1. 13 − 8 = 5.
  4. Does 4 fit into 5? Yes → 1. 5 − 4 = 1.
  5. Does 2 fit into 1? No → 0. Does 1? Yes → 1. 1 − 1 = 0. Done.
1286432168421
00101101

45 = 00101101 in binary. Check: 32 + 8 + 4 + 1 = 45 ✅

🖱️ Try it: build any number 0–255

Type a denary number and see the binary. Then use the interactive bits above to check yourself.

⚠️ Show your working

Conversion questions are usually worth 2 marks: 1 for the answer, 1 for the working. Always leave the place-value table on the page.

Converting binary to denary

Even easier: write out place values above the bits, then add up the columns with a 1.

✏️ Example — convert 01100011
1286432168421
01100011

Add the values where there's a 1: 64 + 32 + 2 + 1 = 99.

🖱️ Try it

💡 Odd number trick

If the binary number ends in 1, the denary answer must be odd. If it ends in 0, the answer must be even. Use this to sanity-check your conversion.

Binary addition

Adding binary works just like column addition in denary — but with only 5 golden rules:

SumAnswerMeaning
0 + 00write 0
0 + 11write 1
1 + 01write 1
1 + 110write 0, carry 1
1 + 1 + 111write 1, carry 1
✏️ Example — 1001 + 0100

Start from the rightmost column, work left. Add each column, applying the rules.

8
4
2
1
A
1
0
0
1
B
0
1
0
0
=
1
1
0
1

1001 (9) + 0100 (4) = 1101 (13) ✅

✏️ Example with carries — 00011001 + 10001001
128
64
32
16
8
4
2
1
A
0
0
0
1
1
0
0
1
B
1
0
0
0
1
0
0
1
C
1
1
1
=
1
0
1
0
0
0
1
0

00011001 (25) + 10001001 (137) = 10100010 (162) ✅

💡 Show carries

Always write carries clearly — either above or below the sum. There are marks for the working, and examiners want to see where the carries went.

Overflow errors

An overflow error happens when the result of a binary addition needs more bits than are available to store it.

At GCSE we work with 8 bits. The biggest 8-bit number is 11111111 (255). If an addition produces a result bigger than 255, a 9th bit would be needed — but it can't be stored. That's an overflow.

✏️ Example — 11111111 + 00000001
256
128
64
32
16
8
4
2
1
A
1
1
1
1
1
1
1
1
B
0
0
0
0
0
0
0
1
=
1
0
0
0
0
0
0
0
0

The correct answer would be 256, but 256 needs a 9th bit. Only 8 bits are stored, so the result reads as 0. That extra 1 (highlighted in red) is the overflow.

⚠️ Exam clue

If an addition question is followed by "what problem has been caused?" — the answer is almost always overflow error.

Binary shifts

A binary shift moves every bit a set number of places to the left or right.

  • Left shift by 1 → multiplies by 2. Left shift by 2 → multiplies by 4. Left shift by n → multiplies by 2n.
  • Right shift by 1 → divides by 2. Right shift by 2 → divides by 4. Right shift by n → divides by 2n.
  • Empty columns are filled with 0.
  • Bits that fall off the end are lost — this can cause loss of precision or overflow/underflow.
✏️ Example — left shift of 1 on 00101000 (40)

Every bit moves 1 place left. The bit in the 128 column falls off. The 1 column is filled with 0.

Result: 01010000 = 64 + 16 = 80. 40 × 2 = 80 ✅

✏️ Example — right shift of 1 on 00101000 (40)

Every bit moves 1 place right. The bit in the 1 column falls off. The 128 column is filled with 0.

Result: 00010100 = 16 + 4 = 20. 40 ÷ 2 = 20 ✅

🖱️ Try it — click the bits, then shift

Set a starting number by clicking bits, then press "shift left" or "shift right".

1280
641
320
161
80
40
20
10
Binary: 00000000 Denary: 0
⚠️ Loss of precision

Right shifts of odd numbers lose data. E.g. shifting 00000101 (5) right by 1 gives 00000010 (2), not 2.5. This is called loss of precision.

Exam-style practice

Q1. Convert the denary number 213 to 8-bit binary.

Q2. Convert the binary number 10110111 to denary.

Q3. Add these binary numbers: 01101100 + 00010101.

Q4. Perform a left shift of 2 on 00001110. What is the effect?

Q5. Adding 11111110 and 00000011 causes what error, and why?

// end of topic 2 — binary