0% found this document useful (0 votes)
7 views

9. Error Detection and Correction

The document discusses error detection and correction techniques in data transmission, including types of errors, redundancy, and methods like forward error correction and retransmission. It covers concepts such as block coding, Hamming distance, and parity-check codes, illustrating how these techniques can identify and correct errors during data transfer. Additionally, it explains modular arithmetic and provides examples of error detection scenarios and their outcomes.

Uploaded by

blackpink7010
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

9. Error Detection and Correction

The document discusses error detection and correction techniques in data transmission, including types of errors, redundancy, and methods like forward error correction and retransmission. It covers concepts such as block coding, Hamming distance, and parity-check codes, illustrating how these techniques can identify and correct errors during data transfer. Additionally, it explains modular arithmetic and provides examples of error detection scenarios and their outcomes.

Uploaded by

blackpink7010
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 62

Note

Data can be corrupted


during transmission.

Some applications require that


errors be detected and corrected.

10.2
Introduction

Let us first discuss some issues related, directly or


indirectly, to error detection and correction.

Topics discussed in this section:


Types of Errors
Redundancy
Detection Versus Correction
Forward Error Correction Versus Retransmission
Coding
Modular Arithmetic
Note

In a single-bit error, only 1 bit in the data unit has


changed.
Figure 10.1 Single-bit error

10.7
Figure 10.2 Burst error of length 8

10.10
Forward error correction analogy
• Analogy: A Magic Letter with Extra Copies
• Imagine you are sending a letter to your friend, but you are worried
that some words might get smudged or lost on the way.
• To solve this, you write extra copies of each important word in the
letter. So even if one or two words get smudged, your friend can still
guess the missing words correctly by looking at the extra copies.
• This is exactly what FEC does! In computers and networks, when data
is sent, some extra information is added so that if anything gets lost
or changed, the receiver can correct it without asking again.
Simple analogy (retransmission)

• Imagine you send a message to a friend on paper.


• If the paper gets lost on the way, you will write and send it again.
• If the paper gets wet and the words are smudged, your friend will ask you to
rewrite and resend it.
Figure The structure of encoder and decoder
• Modular arithmetic is just about finding the remainder after
dividing!
analogy

• Let’s Make Modular Arithmetic Even Simpler! 🍭🍪


• Imagine you have 5 candies 🍬🍬🍬🍬🍬 and 3 friends to share them with. You want
to give each friend an equal number of candies, but some might be left over.
• You start dividing:
• 1st friend gets 1 candy 🍬
• 2nd friend gets 1 candy 🍬
• 3rd friend gets 1 candy 🍬
• Now 2 candies are left! 😲
• So, in modular arithmetic, we write this as:
5 mod 3 = 2 (which means 5 divided by 3 leaves a remainder of 2).
What is Modulo-2 Arithmetic?
• Modulo-2 arithmetic means we divide by 2 and look at the
remainder.
• Any number divided by 2 will have a remainder of either 0 or 1.
Figure XORing of two single bits or two words
BLOCK CODING

In block coding, we divide our message into blocks,


each of k bits, called datawords. We add r redundant
bits to each block to make the length n = k + r. The
resulting n-bit blocks are called codewords.

Topics discussed in this section:


Error Detection
Error Correction
Hamming Distance
Minimum Hamming Distance
10.22
Figure: Datawords and codewords in block coding
Block coding
• Block coding is a method used in error detection and correction
when data is transmitted over noisy channels (like the internet or
radio signals). It helps detect and fix errors without retransmission.
Figure 10.6 Process of error detection in block coding
Figure 10.7 Structure of encoder and decoder in error correction

10.28
Note
The Hamming distance between two words is the number of differences between
corresponding bits.

10.30
• The Hamming distance between two words is the number of
differences between corresponding bits.
Example 10.4

Let us find the Hamming distance between two pairs of


words.

1. The Hamming distance d(000, 011) is 2 because

2. The Hamming distance d(10101, 11110) is 3 because

10.32
Note
The minimum Hamming distance is the smallest Hamming distance between
all possible pairs in a set of words.

10.33
Table 10.1 A code for error detection (Example 10.2)

10.34
Example 10.5

Find the minimum Hamming distance of the coding scheme


in Table 10.1.
Solution
We first find all Hamming distances.

The dmin in this case is 2.

10.35
Table 10.2 A code for error correction (Example 10.3)

10.36
Example 10.6

Find the minimum Hamming distance of the coding scheme


in Table 10.2.

Solution
We first find all the Hamming distances.

The dmin in this case is 3.

10.37
Error detection techniques
Note

A simple parity-check code is a


single-bit error-detecting
code in which
n = k + 1 with dmin = 2.
Table 10.1 A code for error correction
Table 10.1 A code for error detection (Example 10.2)
Table 10.3 Simple parity-check code C(5, 4)
Table 10.3 Simple parity-check code C(5, 4)
Figure 10.10 Encoder and decoder for simple parity-check code
Explanation(simple parity check)
Explanation(simple parity check)
Explanation(simple parity check)
Example (simple parity check)

Let us look at some transmission scenarios. Assume the


sender sends the dataword 1011. The codeword created
from this dataword is 10111, which is sent to the receiver.
We examine five cases:

1. No error occurs; the received codeword is 10111. The


syndrome is 0. The dataword 1011 is created.
2. One single-bit error changes a1 . The received
codeword is 10011. The syndrome is 1. No dataword
is created.
3. One single-bit error changes r0 . The received codeword
is 10110. The syndrome is 1. No dataword is created.
Example (continued)

4. An error changes r0 and a second error changes a3 .


The received codeword is 00110. The syndrome is 0.
The dataword 0011 is created at the receiver. Note that
here the dataword is wrongly created due to the
syndrome value.
5. Three bits—a3, a2, and a1—are changed by errors.
The received codeword is 01011. The syndrome is 1.
The dataword is not created. This shows that the simple
parity check, guaranteed to detect one single error, can
also find any odd number of errors.
• A parity check can detect an odd number of errors (like 1, 3, 5, etc.).
• A parity check cannot detect an even number of errors (like 2, 4, 6,
etc.).
A parity check can detect an odd number of
errors (like 1, 3, 5, etc.).

Example 2: One-Bit Error (Detected)


Suppose an error occurs during transmission, and the received data is
10011 (the second bit flipped from 0 to 1).
1.Count the number of 1s: Four (1, 0, 0, 1, 1)
2.Four is even, but we were expecting an odd count.
3.Since the parity is incorrect, the receiver detects an error.
A parity check cannot detect an even number of
errors (like 2, 4, 6, etc.).

Example 3: Two-Bit Error (Not Detected)


Now, suppose two bits flip instead of one, and the received data is
11011.
1.Count the number of 1s: Still three (1, 1, 0, 1, 1)
2.Since three is still odd, the parity appears correct.
3.The receiver does NOT detect the error.
Note
A simple parity-check code can detect an odd number of errors.
Two-dimensional parity-check code
Figure 10.11 Two-dimensional parity-check code

10.55
Figure 10.11 Two-dimensional parity-check code

10.56
Figure 10.11 Two-dimensional parity-check code

10.57
Figure 10.12 The structure of the encoder and decoder for a Hamming code

10.58
Table 10.5 Logical decision made by the correction logic analyzer

10.60
Example

Let us trace the path of three datawords from the sender to


the destination:
1. The dataword 0100 becomes the codeword 0100011.
The codeword 0100011 is received. The syndrome is
000, the final dataword is 0100.
2. The dataword 0111 becomes the codeword 0111001.
The syndrome is 011. After flipping b2 (changing the 1
to 0), the final dataword is 0111.
3. The dataword 1101 becomes the codeword 1101000.
The syndrome is 101. After flipping b0, we get 0000,
the wrong dataword. This shows that our code cannot
correct two errors.
CHECKSUM and CRC
• Refer hand written notes

You might also like