Two-Dimensional Parity Check: Error Detection (with Worked Example)

Two-Dimensional Parity Check: Error Detection (with Worked Example)

Verified Sources
Nov 4, 2026

A parity check detects certain transmission errors by appending extra bits that describe whether the data has even/odd parity. In a two-dimensional parity check, we write the data into a grid and compute parity across both directions—rows and columns—so the receiver can detect inconsistencies and often localize where corruption occurred.

Mechanically:

  • If parity is computed as even parity, then each row and each column is required to have an even number of 1s.
  • After transmission, the receiver recomputes all row and column parities.
  • If a row parity and a column parity disagree with the expected values simultaneously, the intersection points to a likely corrupted bit location (localization).

A key concept is the Hamming distance: adding row/column parity constraints creates a structured code that has nonzero minimum distance for many error patterns, allowing detection of various single-bit (and some multi-bit) errors. However, like any parity-based method, it cannot guarantee detection of every possible multi-bit corruption. (Specifically, parity checks detect all odd-weight errors within the checked structure, while some even-weight patterns can “cancel out”.)

The core structure can be visualized as:

2D Parity / Parity Check Error Detection (conceptual)

Key learning terms (used throughout)

  • parity
  • row parity
  • column parity
  • detection

How Two-Dimensional Parity Check Detects Errors

Matrix formation

1

Arrange the bitstream into an R×CR\times C grid (optionally padding with 0s)."

Row parity generation

2

For each row, compute a parity bit so the row has the required even/odd parity."

Column parity generation

3

For each column, compute a parity bit so the column has the required even/odd parity."

Transmission

4

Send the data matrix plus all row and column parity bits."

Receiver verification

5

Recompute parity for each row and column; mismatches imply detected errors."

Localization (often possible)

6

A mismatching row and mismatching column intersect at the likely corrupted bit."

Worked Example: Data = 1100101100110000110100101101

We are given the bitstring:

11001011001100001101001011011100101100110000110100101101

Let’s apply a 2D parity check. The length is 2828 bits, which is perfect for arranging into an R×CR\times C matrix as 4times74\\times 7 (since 4cdot7=284\\cdot 7=28).

We will use even parity for both row and column parity bits. (If your course uses odd parity, the procedure is identical—only the parity-bit values change.)

Step 1: Arrange bits into a 4times74\\times 7 matrix

Write the bits row-wise (left to right within a row):

Row 1: 1100101
Row 2: 1001100
Row 3: 0011010
Row 4: 0101101

So the matrix MM is:

Row / Col1234567
R11100101
R21001100
R30011010
R40101101

Compute row parity and column parity (even parity)

  1. 1
    Step 1

    For each row, count 1s. If the count is already even, parity bit = 0; if odd, parity bit = 1 (so total becomes even).

  2. 2
    Step 2

    For each column, repeat the same even-parity rule across the 4 bits in that column.

  3. 3
    Step 3

    Transmit the original matrix plus: one parity bit per row and one parity bit per column.

  4. 4
    Step 4

    Receiver recomputes row/column parity from received matrix; any mismatch indicates an error. A mismatching row and mismatching column point to a particular cell (bit).

Row parity bits (even parity)

Count 1s in each row:

  • Row 1: 1100101 has 44 ones → even → row parity r1=0r_1=0
  • Row 2: 1001100 has 33 ones → odd → row parity r2=1r_2=1
  • Row 3: 0011010 has 33 ones → odd → row parity r3=1r_3=1
  • Row 4: 0101101 has 44 ones → even → row parity r4=0r_4=0

So row parity vector is:

[r1,r2,r3,r4]=[0,1,1,0][r_1,r_2,r_3,r_4] = [0,1,1,0]

Column parity bits (even parity)

Now for each column (from the matrix):

  • Col 1: bits = [1,1,0,0][1,1,0,0] → 22 ones → even → c1=0c_1=0
  • Col 2: bits = [1,0,0,1][1,0,0,1] → 22 ones → even → c2=0c_2=0
  • Col 3: bits = [0,0,1,0][0,0,1,0] → 11 one → odd → c3=1c_3=1
  • Col 4: bits = [0,1,1,1][0,1,1,1] → 33 ones → odd → c4=1c_4=1
  • Col 5: bits = [1,1,0,1][1,1,0,1] → 33 ones → odd → c5=1c_5=1
  • Col 6: bits = [0,0,1,0][0,0,1,0] → 11 one → odd → c6=1c_6=1
  • Col 7: bits = [1,0,0,1][1,0,0,1] → 22 ones → even → c7=0c_7=0

So column parity vector is:

[c1,c2,c3,c4,c5,c6,c7]=[0,0,1,1,1,1,0][c_1,c_2,c_3,c_4,c_5,c_6,c_7] = [0,0,1,1,1,1,0]

How detection works (the key logic)

Consider what happens if exactly one bit flips during transmission (a 1leftrightarrow01\\leftrightarrow 0 error):

  • That flip changes the 1-count of its row by pm1\\pm 1 (toggling parity).
  • It also changes the 1-count of its column by pm1\\pm 1 (toggling parity).
  • Therefore, the parity check will fail for both the corresponding row and corresponding column.

So a single-bit error produces:

  • at least two mismatches (one row, one column),
  • and the intersection of the mismatching row and column identifies the bit’s location.

Why two dimensions detect more than 1D parity

With simple (1D) parity, any even number of flipped bits may cancel and evade detection. With 2D parity, multi-bit errors have to simultaneously preserve every row and every column parity to go undetected.

2D parity still cannot detect every possible multi-bit pattern

If an error flips multiple bits such that each affected row has an even number of changes AND each affected column also has an even number of changes, all parities may remain consistent—so the receiver may not detect it.

Concrete detection scenario (illustrative)

Suppose during transmission, the bit at Row 2, Column 4 flips.

From the matrix, Row 2 is 1 0 0 1 1 0 0, so Column 4 currently is 1. A flip makes it 0.

Effect on parities

  • Row 2: number of 1s decreases by 1 → row parity toggles
    So receiver’s recomputed parity for Row 2 will not match the transmitted r2=1r_2=1.
  • Column 4: Column 4 currently has bits [0,1,1,1][0,1,1,1] (3 ones). After flip at Row 2, it becomes [0,0,1,1][0,0,1,1] (2 ones). Parity toggles again.
    So receiver’s recomputed parity for Column 4 will not match c4=1c_4=1.

Thus, the receiver detects an error by finding:

  • row mismatch at Row 2
  • column mismatch at Column 4

Their intersection uniquely points to cell (2,4)(2,4) in this single-bit-error case.

Summary of what to transmit

For a 4times74\\times 7 matrix:

  • transmit the 2828 data bits,
  • plus 44 row parity bits and 77 column parity bits:
textTotaltransmittedbits=28+4+7=39\\text{Total transmitted bits} = 28 + 4 + 7 = 39

Parity bits to append:

  • Row parity: [0,1,1,0][0,1,1,0]
  • Column parity: [0,0,1,1,1,1,0][0,0,1,1,1,1,0]

Common exam-focused clarifications

Knowledge Check

Question 1 of 3
Q1Single choice

In a 2D parity check with even parity, if exactly one bit flips, which parity sets must mismatch?