AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Year plan · Computing

Counting like a computer

Week 26 · 4.3 Data representation · 3 lessons
2

Eight bits, 256 numbers

Computing 8: Topic 4.3, pp. 268–277
GoalConvert 8-bit binary numbers to denary and back.
New words
byte · a group of 8 bits8-bit binary · a binary number with eight places, worth 128, 64, 32, 16, 8, 4, 2 and 1
Explanation

A group of 8 bits is called a byte. The eight place values are 128, 64, 32, 16, 8, 4, 2 and 1. Each place is double the one to its right. To read an 8-bit number, add the place values that have a 1. If all eight bits are 1, the total is 255, so one byte can hold the numbers from 0 to 255. That is 256 different values. To convert denary to binary, use the same method as before: compare the number with each place value from the left, write 1 and subtract when it fits, and write 0 when it does not. Check by adding your place values back up.

1286432168421
bits01010011
value used641621
Worked examples
1286432168421
bits00101101
Read 00101101. The 1s are in the places worth 32, 8, 4 and 1. Add: 32 + 8 + 4 + 1 = 45.
Place valueCompareBitLeft over
12877 ≥ 128? no077
6477 ≥ 64? yes113
3213 ≥ 32? no013
1613 ≥ 16? no013
813 ≥ 8? yes15
45 ≥ 4? yes11
21 ≥ 2? no01
11 ≥ 1? yes10
Make binary from 77. It is not ≥ 128, so 0. It is ≥ 64, so 1 and 13 are left. 13 is 8 + 4 + 1. The answer is 01001101.
1286432168421
bits11000110
Read 11000110 and check: 128 + 64 + 4 + 2 = 198. Notice how long the numbers are: this is why people do not write long binary numbers all day.
Class activity

Byte hunt (no computer). Draw a row of eight boxes and write 128, 64, 32, 16, 8, 4, 2, 1 above them. Choose any number from 0 to 255 and write its binary in the boxes. Ask a partner to read it and tell you the number. Then swap. Try five numbers each. Try these on purpose: the smallest (all zeros), the largest (all ones), a number with just one 1. Which numbers have only one 1? What do they have in common? (Answer: they are the place values, each double the last.) Check your answers by adding up. No computer is needed.

Practice
1
Convert 10010110 to denary.
1286432168421
bits10010110
2
Convert 200 to 8-bit binary. Show your working.
Place valueCompareBitLeft over
128200 ≥ 128???
64??
32??
16??
8??
4??
2??
1??
3
What are the smallest and largest numbers that one byte can hold, and how many different numbers is that?
4
A pupil says that 00001000 is 8 and 00010000 is 16. Is the pupil right? Explain what happens each time the single 1 moves one place to the left.