Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 11

Central Women’s University

Assignment No: 2
Assignment On Error Detection and Correction
Course Title: Data Communication
Course Code: CSE-313
Submitted By:
Afrina Sultana
ID: 2018-1-17-016
Department of Computer Science and Engineering
Submitted To:
Sher Shermin Azmiri Khan
Assistant Professor
Department of CSE, CWU
Submission Date: 09-06-2020
Error Detection and Correction

Introduction:
Networks must be able to transfer data from one device to another with
acceptable accuracy. Error is a condition when the output information does not
match with the input information.Any time data are transmitted from one node
to the next, they can become corrupted in passage. Some applications require a
mechanism for detecting and correcting errors. During transmission, digital
signals suffer from noise that can introduce errors in the binary bits travelling
from one system to other. That means a 0 bit may change to 1 or a 1 bit may
change to 0.

Types Of errors:
1. Single bit error.

2. Multiple bit error or burst error.

The term single bit error means that only one bit of the given data unit (such as
byte, character or packet) is changed from 0 to 1 or from 1 to 0. Single bit errors
are the least likely type of error in serial data communication.
The term burst error means that two or more bit of the given data unit have
changed from 0 to 1 or from 1 to 0. A burst error does not means that error
occurs in consecutive bits.

Redundancy:
The central concept in detecting and correcting error is redundancy.Basically,
Redundancy is a technique for detection and correction of error in which
redundant bits itself do not have any information or data but they act as data bits.
Redundant bits are added by the sender and are removed by the receiver.

Detection versus Correction:


Error detection is the detection of errors caused by noise or other
impairmentsduring transmission from the transmitter to the receiver. We use
some redundancy codes to detect these errors, by adding to the data while it is
transmitted from source (transmitter). These codes are called “Error detecting
codes”. In error detection, we are only looking to see if any error has occurred.
The answer is a simple yes or no. We are not even interested in the number of
corrupted bits. Four methods of error detection are:

1. VRC.
2. LRC.
3. Checksum.
4. CRC.

Error correction is the detection of errors and reconstruction of the original error
free data. In error correction, we need to know the exact number of bits that are
corrupted and more importantly, their location in the message. Two methods of
error correction are:

1. Reverse error correction (REC).


2. Forward error correction (FEC).

Coding:
The coding schemes are divided into two broad categories:

1. Block Coding.

2. Convolution Coding.

Block Coding:
The term block code may also refer to any error-correcting code that acts on a
block of k bits (Datawords) of input data to produce, add r redundant , n
bits(Codeword) of output data  (n, k).

Length, n = k + r.
Error Detection:
There are two conditions that can detect a change in the original codeword.

1. The receiver has (or can find) a list of valid codewords.

2. The original codeword has changed to an invalid one.

Example:
Let us assume that k = 2 and n = 3. Table 10.1 shows the list of datawords and
codewords.
Assume the sender encodes the dataword 01 as 011 and sends it to the receiver.

Consider thefollowing cases:

1. The receiver receives 011. It is a valid codeword. The receiver extracts the data.

2.The codeword is corrupted during transmission, and 111 is received (the


leftmost bit is corrupted). This is not a valid codeword and is discarded.

3.The codeword is corrupted during transmission, and 000 is received (the right
two bits are corrupted). This is a valid codeword. The receiver incorrectly extracts
the dataword 00. Two corrupted bits have made the error undetectable.

Hamming Distance:
A Hamming distance in information technology represents the number of points
at which two corresponding pieces of data can be different. It is a metric for
comparing two binary data strings. While comparing two binary strings of equal
length, Hamming distance is the number of bit positions in which the two bits are
different. The Hamming distance involves counting up which set of corresponding
digits or places are different and which are the same. One fundamental
application of Hamming distance is to correct binary code either toward one
result or another. It is used for error detection or error correction when data is
transmitted over computer networks. It is also using in coding theory for
comparing equal length data words.

The Hamming distance between two strings, p and q is denoted as d(p, q).

For example: If the codeword 00000 is sent and 01101 is received, 3 bits are in
error and the Hamming distance between the two is d(00000, 01101)=3.
Example:
Let us find the Hamming distance between two pairs of words.

1. The Hamming distance d(000, 011) is 2 because (000 Ф 011) is 011 (two is).
2. The Hamming distance d(10101, 11110) is 3 because (10101Ф 11110) is
01011 (three is).

Minimum Hamming Distance for Error Detection:


To design a code that can detect d single bit errors, the minimum Hamming
distance for the set of codewords must be d + 1 (or more). That way, no set of d
errors in a single bit could turn one valid codeword into some other valid
codeword.

Linear Block Codes:


A block code of length n and 2k code word is called a linear (n, k) code iff its 2k
code words form a k-dimensional sub space of the vector space of all the n-tuple
over the field GF(2). The formal definition of linear block codes requires the
knowledge of abstract algebra. A linear block code is a code in which the exclusive
OR of two valid codewords creates another valid codeword.

Minimum Distance for linear Block Codes:


The minimum Hamming distance is the number of 1s in the nonzero valid
codeword with the smallest number of 1s.
Example:
In the below table, the numbers of 1s in the nonzero codewords are 2,2 and 2. So
the minimum Hamming distance is d min=2.

Parity-Check Code:
A parity check is a process that ensures accurate data transmission between
nodes during communication. The most familiar error-detecting code is the
parity-check code. A simple parity-check code is a single-bit error-detecting code
in which n = k + 1 with dmin = 2(minimum hamming distance). In this code, a k-bit
data word is changed to an n-bit code word where n = k + 1. The extra bit, called
the parity bit, is selected to make the total number of 1s in the code word even.
Although some implementations specify an odd number of 1s. The minimum
Hamming distance for this category is dmin =2, which means that the code is a
single-bit error-detecting code and it cannot correct any error.

The following figure shows possible structure of an encoder (at the sender) and a
decoder (at the receiver).
Here we can see that the encoder uses a generator which takes a copy of a 4-bit
data word as a0, a1, a2 and a3 and generates a parity bit r0. The data word bits
and the parity bit create the 5 bit codeword. We know that the added parity bit
makes the number of 1s in the codeword even. So,

            r0=a3+a2+a1+a0 (modulo-2)

If the number of 1s is even, the result will be 0 and if the number of 1s is odd, the
result will be 1. In both cases, the total number of 1s in the codeword is even.

The codeword sent by a sender sometimes can be corrupted during transmission.


The receiver receives a 5-bit word. The checker at the receiver does the same
work as the generator in the sender does with one exception that is the addition
is done over all 5 bits. So,

s0=b3+b2+b1+b0+ q0 (modulo-2)

The result, which is called the syndrome is just 1 bit. When the number of 1s in
the received code word is even, the syndrome is 0, otherwise it is 1.

The syndrome is passed to the decision logic analyzer. If the syndrome is 0, there
is no error in the received codeword, if the syndrome is 1, the data portion of the
received code word is discarded.
Example:
The sender sends the data word 1011. The code word created from this data
word is 10111, which is sent to the receiver. We examine five cases:

1. No error occurs and the received codeword is 10111. The syndrome is 0. The
data word 1011 has been created.

2. One single-bit error changes a1. The received code word is 10011. No data
word is created. The syndrome is 1. No data word is created.

3. One single-bit error changes r0. The received code word is 10110. The
syndrome is 1. No data word is created.

4. An error changes r0 and a second error changes a3. The received code word is
00110. The syndrome is O. The data word 0011 is created at the receiver.

5. Three bits-a3, a2, and a1-are changed by errors. The received code word is
01011. The syndrome is 1. The data word is not created. This shows that the
simple parity check guaranteed to detect one single error can also find any odd
number of errors.

Conclusion:
Whenever a message is transmitted, it may get scrambled by noise or data may
get corrupted. To avoid this, we use error-detecting codes. If these errors are not
detected and corrected, data will be lost.The codes which are used for both error
detecting and error correction are called as “Error Correction Codes”. To keep
data safe, error detection and correction are equally important in data
communication.

You might also like