Error Detection and Correction in Digital Communications
Department of Electrical and Communication Engineering,
Masinde Muliro University of Science & Technology
1. Introduction to 2D Parity Check
Two-dimensional (2D) parity checking, also known as Longitudinal Redundancy Check (LRC) combined with Vertical Redundancy Check (VRC), is an error detection and correction technique used in digital communications and data storage systems.
Key Concept: 2D parity extends the simple 1D parity check by organizing data into a matrix and calculating parity bits for both rows and columns, enabling the detection and correction of single-bit errors.
2. Mathematical Foundation
2.1 Parity Bit Calculation
For a data matrix with m rows and n columns:
Row Parity: Prow,i = di,1 ⊕ di,2 ⊕ ... ⊕ di,n (for i = 1 to m)
Data Link Layer: Used in ARQ (Automatic Repeat Request) protocols
Memory Systems: DRAM error correction
Storage Systems: RAID arrays
Satellite Communication: Where retransmission is costly
Embedded Systems: Critical data integrity checking
5. Efficiency Analysis
Redundancy ratio for an m×n matrix:
Efficiency η = (m × n) / [(m+1) × (n+1)] × 100%
64%4×4
79%8×8
Data Efficiency: 4×4 vs 8×8 Matrix
Interactive 2D Parity Matrix Simulator
Experiment with 2D parity matrices. Select matrix size (4×4 or 8×8), click on data cells to flip bits and observe error detection and correction capabilities.
4×4 Matrix: 16 data bits + 9 parity bits = 25 total bits (64% efficiency)
Data Bits
Parity Bits
Corner Parity
Error Detected
Manual Error Injection
Click on any data cell in the matrix above to inject an error (flip the bit). Then use "Check & Correct" to detect and fix it.
💡 Select a matrix size and click "Generate New Matrix" to start the simulation
Simulation Results
Simulation results will appear here...
Experimental Procedure
Step 1: Understanding the Setup
Familiarize yourself with the 2D parity matrix structure. Understand that:
Data bits form the main matrix (m × n)
Row parity bits are appended to each row
Column parity bits are appended to each column
The corner bit ensures overall parity consistency
Step 2: Matrix Generation (4×4)
Select 4×4 matrix size
Choose parity type (Even or Odd)
Click "Generate New Matrix" to create a random data matrix
Observe how parity bits are calculated and positioned
Manually verify at least one row and one column parity calculation
Record: Total bits = 25, Data bits = 16, Efficiency = 64%
Step 3: Matrix Generation (8×8)
Switch to 8×8 matrix size
Generate a new matrix
Compare with 4×4 matrix:
Total bits = 81, Data bits = 64, Efficiency = 79%
Note the improved efficiency with larger matrix
Verify parity calculations
Step 4: Single Error Injection and Detection (Both Sizes)
Inject a single-bit error by clicking on any data cell
Note the position of the error (row i, column j)
Click "Check & Correct" to run the error detection algorithm
Observe how the system identifies the error location
Verify that the error is corrected automatically
Record the row and column parity mismatch indicators
Repeat for both 4×4 and 8×8 matrices
Step 5: Multiple Error Analysis
Generate a fresh matrix (try both sizes)
Inject two errors in different rows and columns
Attempt detection and correction
Record whether the errors are detected
Note: 2D parity can detect but NOT correct double errors
Repeat with three errors and four errors (rectangular pattern)
Step 6: Burst Error Simulation
Create a matrix with adjacent errors (burst)
Test detection capability
Vary the burst length from 2 to n bits
Analyze detection probability vs burst length
Compare results between 4×4 and 8×8 matrices
Step 7: Efficiency Comparison
Calculate for 4×4: Overhead = 9/25 = 36%
Calculate for 8×8: Overhead = 17/81 = 21%
Compare and analyze which size is more efficient
Discuss trade-offs between efficiency and error localization
Step 8: Comparative Analysis
Compare even vs odd parity performance
Test with all-zeros and all-ones data patterns
Analyze worst-case scenarios
Document limitations observed for both matrix sizes
Data Recording Table
Use this template to record your experimental data:
Exp #
Matrix Size
Errors Injected
Error Pattern
Detected?
Corrected?
Comments
1
4×4
1
Single bit
Yes/No
Yes/No
2
4×4
2
Different rows/cols
Yes/No
N/A
3
4×4
4
Rectangle pattern
Yes/No
N/A
4
8×8
1
Single bit
Yes/No
Yes/No
5
8×8
2
Same row
Yes/No
N/A
6
8×8
4
Rectangle pattern
Yes/No
N/A
Lab Report Guidelines
1. Title Page
Experiment Title: 2D Parity Matrix Error Detection and Correction
Course Name and Code
Student Name and ID
Date of Experiment
Instructor Name
2. Abstract (150-200 words)
Briefly summarize:
Objective of the experiment
Methodology used (2D parity checking with 4×4 and 8×8 matrices)