Year 8Technology 50 min
We are learning to
- We are learning how parity is used to detect and correct errors in binary data.
Success criteria: I can…
- I can add parity cards to a grid so every row and column has an even number of coloured cards.
- I can find a flipped card using the row and column that have an odd count.
- I can work out an even parity bit for a binary number and check received data for an error.
- I can explain one thing parity checking cannot do.
Key competenciesThinkingUsing language, symbols and textsRelating to others
Lesson sequence
50 min total- 1
The trick
Starter 0–8 minTeacher- Before the lesson, read the worked example in the resources so you can add the parity cards quickly.
- Ask two volunteers to lay 25 two-sided cards on the board or floor in a 5 by 5 grid. Say: "Mix them up. Some coloured side up, some white side up. Any pattern you like."
- Say: “"I will make it a bit harder for myself by adding more cards." Add one extra card to the end of each row and one to the bottom of each column, plus the corner, to make a 6 by 6 grid. Choose each one so that its row or column has an even number of coloured cards.”
- Say: “I will turn my back. One of you flip exactly one card over. Everyone else, remember which one.”
- Turn back. Scan each row for an odd number of coloured cards, then each column. The flipped card is where the odd row and odd column cross. Point to it and flip it back.
- Repeat once with a new volunteer.
- Ask: How am I doing it? Talk to the person beside you. One clue: the extra cards were not random.
- Take two or three ideas. Do not confirm yet.
Students- Lay out the grid and flip a card while the teacher's back is turned.
- Watch the teacher find the flipped card.
- Discuss how the trick might work.
36 two-sided cards (one side coloured, one side white) with magnets or sticky tack if using the boardWorked example for the teacher, on a 4 by 4 grid (1 = coloured side up, 0 = white). Data rows: 1 0 1 1, then 0 0 1 0, then 1 1 0 0, then 0 1 1 1. The rows have 3, 1, 2 and 3 coloured cards, so the parity cards at the end of the rows are 1, 1, 0, 1. The columns have 2, 2, 3 and 2 coloured cards, so the parity row along the bottom is 0, 0, 1, 0. The corner card is 1, which makes both the bottom row and the last column even. Every row and column of the finished 5 by 5 grid now has an even number of 1s.
- 2
How it works: even parity
Main 8–18 minTeacher- Lay out a fresh 5 by 5 grid and add the extra row and column again, slowly this time.
- Say: “"Count the coloured cards in the top row, including my extra card." Do every row with the class. (Each count is even: 0, 2, 4 or 6.)”
- Ask: What do you notice? (Every row has an even number of coloured cards.)
- Say: “"Check the columns." (Also even.)”
- Say: “Whether a number is even or odd is called its parity. I added each extra card to make the count even. They are parity cards.”
- Flip one card yourself. Ask: "Count the coloured cards in this row now." (Odd.) "And in this column?" (Odd.) "Every other row and column?" (Still even.)
- Ask: Why does flipping one card always make its row odd? (Flipping changes the count by one, up or down. An even number plus or minus one is odd.)
- Say: “So the odd row and the odd column point to the card, like coordinates.”
- Say: “Now replace cards with bits. Coloured is 1, white is 0. A computer stores data as bits and adds parity bits in the same way. If a bit gets flipped by a fault or interference, the parity is wrong and the computer knows.”
- Ask: A row of data bits is 1 0 1 1 0. What parity bit makes the number of 1s even? (1. There are three 1s, and one more makes four.)
- Ask: And for 1 1 0 0 0? (0. There are already two 1s.)
Students- Count the coloured cards in each row and column and spot the pattern.
- Explain why one flip makes a row and a column odd.
- Work out the parity bit for two rows of bits.
The 36 two-sided cards - 3
Do the trick yourself
Main 18–30 minTeacher- Put students in pairs. Give each pair a grid sheet and 25 two-sided counters or small cards.
- Say: “Partner A lays a 4 by 4 grid, any pattern. Partner B adds the parity row and column to make 5 by 5. Start with the row parity cards, then the bottom row, and do the corner last.”
- Say: “Check each other. Every row and every column must have an even number coloured side up. Zero counts as even.”
- Say: “Then B looks away, A flips one, and B finds it. Swap roles. Do it at least twice each.”
- Move around the pairs. Ask: "Which row is odd? Which column? So where is the error?"
- Ask: Does the trick still work if the flipped card is one of the parity cards? (Yes. Its row and column still go odd.)
- After 8 minutes, say: "New challenge. A flips two cards that are in different rows and different columns. What does B see?" (Two odd rows and two odd columns. B knows something is wrong but there are four places where they cross, so B cannot be sure which two cards flipped.)
- Say: “So with two errors, we can detect that there is a problem, but we cannot correct it.”
Students- Build a 4 by 4 grid and add the parity row and column.
- Take turns to flip one card and find it using the odd row and column.
- Test what happens when two cards are flipped.
For each pair: 25 two-sided counters, or 25 small squares of card coloured on one side A grid sheet for each pair with a 5 by 5 grid of squares large enough for the counters - 4
Parity bits on binary data
Main 30–42 minTeacher- Say: “Often data is sent in small groups with one parity bit on the end. We will use 7 data bits plus 1 parity bit, with even parity.”
- Model on the board: 1 0 0 1 1 0 1. Say: "Count the 1s. Four. That is already even, so the parity bit is 0. We send 1 0 0 1 1 0 1 0."
- Model a check: "We receive 0 1 1 1 0 0 0 0. Count the 1s. Three. Odd. So there is an error somewhere in these eight bits."
- Ask: Can we tell which bit is wrong? (No. One parity bit detects the error but does not locate it.)
- Ask: What should the receiving computer do? (Ask for the data to be sent again.)
- Say: “Work through the practice set with your partner. Six minutes.”
- Questions
- 1.Add the parity bit: 1011001 (0, because there are four 1s)
- 2.Add the parity bit: 1110000 (1, because there are three 1s)
- 3.Add the parity bit: 0000001 (1, because there is one 1)
- 4.Add the parity bit: 1111111 (1, because there are seven 1s)
- 5.Received 10110010. Error or no error found? (No error found: four 1s)
- 6.Received 11100000. Error or no error found? (Error: three 1s)
- Go over the answers. For questions 7 and 8 in the resources, ask pairs to hold up fingers: one for error, two for no error found.
- Tip: Students who count 0s by mistake get some answers right by luck. Ask them to underline each 1 as they count.
Students- Follow the two modelled examples.
- Work through the practice set with a partner.
- Check answers and correct any mistakes.
Practice set (even parity, 7 data bits plus 1 parity bit)Add the parity bit.
- 1.1011001
- 2.1110000
- 3.0000001
- 4.1111111 These 8 bits were received. Write 'error' or 'no error found'.
- 5.10110010
- 6.11100000
- 7.01010111
- 8.11001100 Answers: 1. 0 2. 1 3. 1 4. 1 5. No error found (four 1s) 6. Error (three 1s) 7. Error (five 1s) 8. No error found (four 1s)
- 5
Where parity fails
Plenary 42–50 minTeacher- Write on the board: Sent 1 0 1 1 0 0 1 0. Received 1 1 1 1 0 0 0 0.
- Ask: How many bits changed on the way? (Two: the second bit and the seventh bit.)
- Ask: Count the 1s in what was received. What will the computer decide? (Four 1s. Even. It finds no error, although the data is wrong.)
- Ask: So what is the weakness of a single parity bit? (It misses any even number of flipped bits, because the count stays even.)
- Say: “That is why question 5 said 'no error found' and not 'correct'. Parity is cheap and catches the most common case, a single flipped bit. Systems that need more protection use stronger checks built on the same idea of adding extra information worked out from the data.”
- Say: “A related idea you see every day is the check digit: the last digit of a barcode number is calculated from the other digits, so a scanner can tell when a number has been misread.”
- Exit task on paper, done alone
- 1.Add an even parity bit to 1100101. (0, because there are four 1s)
- 2.These 8 bits arrive: 01101111. Error or no error found? (No error found: six 1s)
- 3.In one sentence, explain why the card grid can correct a single error but a single parity bit cannot. (The grid has a parity check for every row and every column, so the odd row and odd column cross at the wrong bit. One parity bit only says that something in the group is wrong.)
- Collect the exit tasks.
Students- Work out what a parity check decides when two bits flip.
- State the weakness of a single parity bit.
- Complete the three-question exit task alone.
Paper for the exit task
Key vocabulary
bit
The smallest piece of digital data. It has two possible values, written 0 and 1.
binary
A way of representing data using only two symbols, 0 and 1.
error
In data, a bit that has changed from what was stored or sent.
parity
Whether a count is even or odd.
parity bit
An extra bit added to data so that the total number of 1s is even (in even parity).
error detection
Finding out that data has been changed.
error correction
Working out which bit is wrong and changing it back.
Differentiation
Support
- Start the pair on a 3 by 3 grid with a parity row and column (4 by 4 in total) and have them write the count of coloured counters at the end of each row and under each column, circling any odd count.
- For the binary practice, give a strip with eight boxes so students write one bit in each box and put a dot under every 1 before counting.
Extension
- Ask the pair to find the smallest number of flips on the card grid that leaves every row and column even, so the error is completely invisible, and to describe the pattern. (Four flips at the corners of a rectangle.)
- Ask the pair to redo practice questions 1 to 4 using odd parity (the total number of 1s must be odd) and to say whether odd parity detects single errors just as well, with a reason.
Accessibility
- Use counters or cards with a clear contrast that does not rely on colour vision, such as black and white, or a cross on one side.
- Students who find fine handling of counters hard can direct their partner, or work on a printed grid with a pencil, shading squares and marking the flipped one with a cross.
- Write the rule in one line and keep it on the board: every row and every column must have an even number of 1s. This supports students who are new to English and anyone who loses track during pair work.
Assessment
- During pair work, check one finished grid from each pair: every row and column, including the parity row and column, should have an even count.
- During the practice set, look for correct parity bits in questions 1 to 4 and the wording 'no error found' for questions 5 and 8.
- Collect the exit task. Question 3 shows whether the student can explain the difference between detecting an error and locating it.
Resources
- 36 large two-sided cards for the demonstration (coloured on one side, white on the other), with magnets or sticky tack
- 25 two-sided counters or small card squares for each pair
- A grid sheet for each pair
- The practice set, displayed or printed
- Paper for the exit task