GoalExplain how sound and text are stored in binary and read a simple binary code.
New words
analogue to digital converter (ADC) · a part that measures a sound and changes it into binary numbersbyte · a group of 8 bitscharacter code · the unique pattern of 8 bits that stands for one letter, number or symbolplace value · the value of a digit because of where it is in a number
Explanation
Sound is analogue. It changes smoothly, so it cannot go straight into a computer. A microphone picks it up, and an analogue to digital converter measures it many times a second. Each measurement is stored as a binary number. Text is stored in binary as well. Every key you press sends a different pattern of 8 bits to the processor. A group of 8 bits is a byte. In a binary number each place has a value: 128, 64, 32, 16, 8, 4, 2 and 1, from the left. Add the values where there is a 1. For example, the letter A has the code 01000001, because 64 + 1 = 65.
128
64
32
16
8
4
2
1
0
1
0
0
0
0
0
1
Worked examples
128
64
32
16
8
4
2
1
0
0
0
0
1
1
0
1
To change a binary number into an ordinary number, add the place values that have a 1. Here is 00001101: 8 + 4 + 1 = 13.
Letter
Code
K
01001011
L
01001100
M
01001101
N
01001110
Each letter has its own code. Here are some letters. A message is just a list of codes, one byte for each letter.
Reading
1
2
3
4
height
2
5
7
4
binary
010
101
111
100
A converter measures a sound and stores each reading as a binary number. Here are four readings with heights from 0 to 7. Each reading is stored with 3 bits. All four need 12 bits.
Class activity
Secret byte message (no computer): write a chart of the letters A to J with their 8-bit codes (A = 01000001, B = 01000010, and so on, adding 1 each time). Choose a short word, write its letters as codes and give the codes to a partner. Your partner decodes it using the chart. Count the bits: letters × 8. Then try one number: write 21 in binary using the place values and check that you get 00010101. If you have a computer or tablet, an adult can help you type a short word in a text editor and count its characters, to check your bit count.
Practice
1
Decode this message using the chart: 01000011 01000001 01000111 01000101. What word is it?
Letter
Code
A
01000001
B
01000010
C
01000011
D
01000100
E
01000101
F
01000110
G
01000111
H
01001000
I
01001001
J
01001010
The codes stand for C, A, G, E. The word is CAGE.
2
Change 00010110 into an ordinary number.
16 + 4 + 2 = 22.
3
How many bits does the message ‘HI MUM’ need if each character uses 8 bits? Count the space as a character.
There are 6 characters, so 6 × 8 = 48 bits (6 bytes).
4
Explain why a computer needs an analogue to digital converter before it can store a sound.
A sound is an analogue signal that changes smoothly. Computers can only store binary, so the converter measures the sound and turns each measurement into 0s and 1s.