Working out the parity bit for a byte

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Working out the parity bit for a byte

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Even parity. The 7 data bits are 1011001. What is the parity bit?
A 0, because there are four 1s, which is already even
B 1, because there are four 1s and it must be made even
2. Odd parity. The 7 data bits are 1011001. What is the parity bit?
A 0, because four 1s is already odd
B 1, to make the total number of 1s five (odd)
3. Even parity. The data bits are 0110100. Which full 8-bit byte is correct?
A 00110100
B 10110100
4. Odd parity. The data bits are 1110000. Which full 8-bit byte is correct?
A 01110000
B 11110000
5. Where is the parity bit written in an 8-bit byte with 7 data bits?
A In the leftmost place, in front of the 7 data bits
B In the rightmost place, after the 7 data bits

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1Even parity, data 1011001 -> 01011001 AThe parity bit was put at the right-hand end. It belongs in the leftmost place, so the byte should be 11111000.
2Odd parity, data 1011001 -> 11011001 BThe data has four 1s, which is already even, so the parity bit is 0 and the whole byte keeps an even number of 1s.
3ASCII 'A' is 1000001 in 7 bits. It has two 1s, so with even parity the parity bit is 0. C01000001
4ASCII 'C' is 1000011 in 7 bits. It has three 1s, so with even parity the parity bit is 1. D11000011
5Even parity, data 1100100 -> 01100100 EThe data has three 1s, which is odd. The parity bit must be 1 to make four 1s, so the byte should be 11100100.
6Odd parity, data 1111000 -> 11110001 FThe data has four 1s, which is even, so the parity bit is 1 to make five 1s, an odd total.

Definitions

count the 1s

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
Data: 1011001 Count of 1s: 4 Even parity bit: _
2.
Data: 1100110 (four 1s) Odd parity bit: _
3.
Char A = 1000001 (ASCII, 7 bits) Even parity byte: _1000001
4.
Char C = 1000011 (three 1s) Odd parity byte: _1000011
5.
Data: 0101010 (three 1s) Bit for even parity: 1 Total 1s in byte: _

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A Rule: even parity
B Data bits: 1011001
C Count of 1s: 5
D Parity bit: 0
E Byte: 01011001
Question 2
A Rule: odd parity
B Data bits: 0110100
C Count of 1s: 3
D Parity bit: 1
E Byte: 00110100
Question 3
A Rule: odd parity
B Data bits: 1110000
C Count of 1s: 3
D Parity bit: 1
E Byte: 11110000
Question 4
A Character: A (ASCII 65)
B 7 data bits: 1000011
C Count of 1s: 2
D Even parity bit: 0
E Byte: 01000001
Question 5
A Character: C (ASCII 68)
B 7 data bits: 1000011
C Count of 1s: 3
D Even parity bit: 1
E Byte: 11000011

Answer Key

Working out the parity bit for a byte
Section A: Quick Questions
Q1
A — 0, because there are four 1s, which is already even
Q2
B — 1, to make the total number of 1s five (odd)
Q3
B — 10110100
Q4
A — 01110000
Q5
A — In the leftmost place, in front of the 7 data bits
Section B: Match the Pairs
Q1
Even parity, data 1011001 -> 01011001 → The data has four 1s, which is already even, so the parity bit is 0 and the whole byte keeps an even number of 1s.
Q2
Odd parity, data 1011001 -> 11011001 → The data has four 1s, which is even, so the parity bit is 1 to make five 1s, an odd total.
Q3
ASCII 'A' is 1000001 in 7 bits. It has two 1s, so with even parity the parity bit is 0. → 01000001
Q4
ASCII 'C' is 1000011 in 7 bits. It has three 1s, so with even parity the parity bit is 1. → 11000011
Q5
Even parity, data 1100100 -> 01100100 → The data has three 1s, which is odd. The parity bit must be 1 to make four 1s, so the byte should be 11100100.
Q6
Odd parity, data 1111000 -> 11110001 → The parity bit was put at the right-hand end. It belongs in the leftmost place, so the byte should be 11111000.
Section C: Definitions
Q1
count the 1s — Count the 1s in the 7 data bits, then set the leftmost parity bit to 0 or 1 so the total number of 1s in the whole 8-bit byte matches the agreed rule (even or odd).
Section D: Fill in the Blanks
Q1
Data: 1011001 Count of 1s: 4 Even parity bit: 0
Q2
Data: 1100110 (four 1s) Odd parity bit: 1
Q3
Char A = 1000001 (ASCII, 7 bits) Even parity byte: 01000001
Q4
Char C = 1000011 (three 1s) Odd parity byte: 01000011
Q5
Data: 0101010 (three 1s) Bit for even parity: 1 Total 1s in byte: 4
Section E: Spot the Error
Q1
C — The data bits 1011001 contain four 1s, not five. The count should be 4, so even parity needs a parity bit of 0.
Q2
D — There are already three 1s, which is odd. Odd parity needs no extra 1, so the parity bit must be 0. A parity bit of 1 would make four 1s, which is even.
Q3
A — The parity bit of 1 makes the total four 1s, which is even. So the rule must be even parity. With odd parity, the parity bit would have been 0.
Q4
B — ASCII 65 is 1000001 in 7 bits, which has two 1s. The broken line shows 1000011, which is ASCII 67 (the letter C).
Q5
A — The data bits 1000011 are ASCII 67, which is the letter C. ASCII 68 is D (1000100), so the code number on line 1 does not match the rest of the program.