Interactive end-of-chapter exercises


Error Detection and Correction: Two Dimensional Parity

Suppose that a packet’s payload consists of 10 eight-bit values (e.g., representing ten ASCII-encoded characters) shown below. (Here, we have arranged the ten eight-bit values as five sixteen-bit values):

Figure 1

01011001 11010100
10100101 00101011
11011110 10101010
10111011 11111001
01001011 11100000

Figure 2

Both the payload and parity bits are shown. One of these bits is flipped.

01011010 10100110 0
00111111 10100000 0
11111100 11111011 0
11011011 00100010 0
01110100 00001110 1
00110110 10010001 1

Figure 3

Both the payload and parity bits are shown; Either one or two of the bits have been flipped.

00101111 01001010 0
10111010 00100000 0
11110001 10110000 1
01110111 01111010 1
11101101 01010110 0
11111111 11110110 1


Question List


1. For figure 1, compute the two-dimensional parity bits for the 16 columns. Combine the bits into one string

2. For figure 1, compute the two-dimensional parity bits for the 5 rows (starting from the top). Combine the bits into one string

3. For figure 1, compute the parity bit for the parity bit row from question 1. Assume that the result should be even.

4. For figure 2, indicate the row and column with the flipped bit (format as: x,y), assuming the top-left bit is 0,0

5. For figure 3, is it possible to detect and correct the bit flips? Yes or No




Solution


The full solution for figure 1 is shown below:

01011001 11010100 0
10100101 00101011 0
11011110 10101010 0
10111011 11111001 0
01001011 11100000 1
11010010 01001100 1

1. The parity bits for the 16 columns is: 11010010 01001100

2. The parity bits for the 5 rows is: 00001

3. The parity bit for the parity row is: 1

4. The bit that was flipped in figure 2 is (9,2):

01011010 10100110 0
00111111 10100000 0
11111100 11111011 0
11011011 00100010 0
01110100 00001110 1
00110110 10010001 1

For figure 3, the bits that were flipped are (7,2) and (16,5):

00101111 01001010 0
10111010 00100000 0
11110001 10110000 1
01110111 01111010 1
11101101 01010110 0
11111111 11110110 1

5. No, with 2D parity, you can detect the presence of two flipped bits, but you can't know their exact locations in order to correct them.



That's incorrect

That's correct

The answer was: 1101001001001100

Question 1 of 5

The answer was: 00001

Question 2 of 5

The answer was: 1

Question 3 of 5

The answer was: 9,2

Question 4 of 5

The answer was: No

Question 5 of 5

Try Another Problem

We’d appreciate your leave us feedback on this networking tutor.

We gratefully acknowledge the programming and problem design work of John Broderick (UMass '21), which has really helped to substantially improve this site. The networking tutor was designed and implemented by Hashim Zia and Shayan Ahmad from New York University Abu Dhabi.

Copyright © 2010-2025 J.F. Kurose, K.W. Ross
Comments welcome and appreciated: kurose@cs.umass.edu