Error detection & Correction
Error detection & Correction
Digital
signals suffer from noise during transmission that can introduce errors in the binary bits
traveling from sender to receiver. That means a 0 bit may change to 1 or a 1 bit may change
to 0.
Types of Errors
Single-Bit Error
A single-bit error refers to a type of data transmission error that occurs when one bit (i.e., a
single binary digit) of a transmitted data unit is altered during transmission, resulting in an
incorrect or corrupted data unit.
Burst Error
When several consecutive bits are flipped mistakenly in digital transmission, it creates a
burst error. This error causes a sequence of consecutive incorrect values.
Error Detection Methods
To detect errors, a common technique is to introduce redundancy bits that provide
additional information. Various techniques for error detection include:
Longitudinal Redundancy Check
Vertical Redundancy Check
Checksum
Cyclic Redundancy Check (CRC)
Longitudinal Redundancy Check is a simple error detection method that involves adding
an extra bit to a data transmission. It works as:
1 is added to the block if it contains an odd number of 1’s, and
0 is added if it contains an even number of 1’s
This scheme makes the total number of 1’s even, that is why it is called even
parity checking.
Advantages
It can detect all single bit error.
It can detect an odd number of errors.
Disadvantages
It is not able to detect even no. of bit error.
For example, the Data to be transmitted is 101010. Codeword transmitted to the
receiver is 1010101 (we have used even parity).
Let’s assume that during transmission, two of the bits of code word flipped to 1111101.
On receiving the code word, the receiver finds the no. of ones to be even and hence no
error, which is a wrong assumption.
Vertical Redundancy Check
In this technique check bits are calculated for each row, which is equivalent to a simple
parity check bit. Parity check bits are also calculated for all columns, then both are sent
along with the data. At the receiving end, these are compared with the parity bits calculated
on the received data.
Advantages
It can detect and correct all single bit error.
It can also detect two- or three-bit error that occur anywhere in the matrix.
Disadvantages
It cannot correct two- or three-bit error. It can only detect two- or three-bit error.
If we have error in the parity bit then this scheme will not work.
Checksum
Checksum error detection is a method used to identify errors in transmitted data. The
process involves dividing the data into equally sized segments and using a 1’s
complement to calculate the sum of these segments. The calculated sum is then sent along
with the data to the receiver. At the receiver’s end, the same process is repeated and if all
zeroes are obtained in the sum, it means that the data is correct.
Checksum – Operation at Sender’s Side
Firstly, the data is divided into k segments each of m bits.
On the sender’s end, the segments are added using 1’s complement arithmetic to get the
sum. The sum is complemented to get the checksum.
The checksum segment is sent along with the data segments.
Checksum – Operation at Receiver’s Side
At the receiver’s end, all received segments are added using 1’s complement arithmetic
to get the sum. The sum is complemented.
CRC
Working
We have given dataword of length n and divisor of length k.
Step 1: Append (k-1) zero’s to the original message
Step 2: Perform modulo 2 division
Step 3: Remainder of division = CRC
Step 4: Code word = Data with append k-1 zero’s + CRC
Note:
CRC must be k-1 bits
Length of Code word = n+k-1 bits
Example: Let’s data to be send is 1010000 and divisor in the form of polynomial is x 3+1.
CRC method discussed below.
Error Correction Techniques:
Redundant bits are extra binary bits that are generated and added to the
information-carrying bits of data transfer to ensure that no bits were lost
during the data transfer. The number of redundant bits can be calculated
using the following formula:
2r ≥ m + r + 1
Algorithm of Hamming Code
Hamming Code is simply the use of extra parity bits to allow the
identification of an error.
Step 1: Write the bit positions starting from 1 in binary form (1, 10, 11,
100, etc).
Step 2: All the bit positions that are a power of 2 are marked as parity bits
(1, 2, 4, 8, etc).
Step 3: All the other bit positions are marked as data bits.
Step 4: Each data bit is included in a unique set of parity bits, as
determined its bit position in binary form:
a. Parity bit 1 covers all the bits positions whose binary representation
includes a 1 in the least significant position (1, 3, 5, 7, 9, 11, etc).
b. Parity bit 2 covers all the bits positions whose binary representation
includes a 1 in the second position from the least significant bit (2, 3, 6,
7, 10, 11, etc).
c. Parity bit 4 covers all the bits positions whose binary representation
includes a 1 in the third position from the least significant bit (4–7, 12–
15, 20–23, etc).
d. Parity bit 8 covers all the bits positions whose binary representation
includes a 1 in the fourth position from the least significant bit bits (8–
15, 24–31, 40–47, etc).
e. In general, each parity bit covers all bits where the bitwise AND of
the parity position and the bit position is non-zero.
Step 5: Since we check for even parity set a parity bit to 1 if the total
number of ones in the positions it checks is odd. Set a parity bit to 0 if the
total number of ones in the positions it checks is even.
Determining The Position of Redundant Bits
A redundancy bits are placed at positions that correspond to the power of
2. As in the above example:
The number of data bits = 7
The number of redundant bits = 4
The total number of bits = 7+4=>11
The redundant bits are placed at positions corresponding to power of 2
that is 1, 2, 4, and 8
To find the redundant bit R2, we check for even parity. Since the total
number of 1’s in all the bit positions corresponding to R2 is odd the
value of R2(parity bit’s value)=1
R4 bit is calculated using parity check at all the bits positions whose
binary representation includes a 1 in the third position from the least
significant bit. R4: bits 4, 5, 6, 7
To find the redundant bit R4, we check for even parity. Since the total
number of 1’s in all the bit positions corresponding to R4 is odd so the
value of R4(parity bit’s value) = 1
R8 bit is calculated using parity check at all the bits positions whose
binary representation includes a 1 in the fourth position from the least
significant bit. R8: bit 8,9,10,11
To find the redundant bit R8, we check for even parity. Since the total
number of 1’s in all the bit positions corresponding to R8 is an even
number the value of R8(parity bit’s value)=0. Thus, the data transferred
is: