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

Error detection code Lecture-10

The document discusses error detecting and correcting codes in digital electronics, focusing on Checksum, Cyclic Redundancy Check (CRC), and Hamming Code. It explains the procedures for error detection and correction, including the use of parity bits and Hamming distance. The lecture outlines how these codes ensure data integrity during transmission by identifying and correcting errors in the data bitstream.

Uploaded by

mohitburnwal2
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)
2 views

Error detection code Lecture-10

The document discusses error detecting and correcting codes in digital electronics, focusing on Checksum, Cyclic Redundancy Check (CRC), and Hamming Code. It explains the procedures for error detection and correction, including the use of parity bits and Hamming distance. The lecture outlines how these codes ensure data integrity during transmission by identifying and correcting errors in the data bitstream.

Uploaded by

mohitburnwal2
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/ 14

Paper Name: Digital Electronics

Paper Code: BCAC-102

Lecture#10
Error Detecting & Correcting Codes in Digital Electronics

Dr. Dibyendu Kumar Pal ,


M.Sc.(Applied Maths), MCA, Ph.D.
HOD & Assistant Professor
Department of Computer Application
Asansol Engineering College, West Bengal, India.
Lecture Outline
Error detecting codes
 Checksum
 Cyclic Redundancy Check (CRC)

Error correcting codes


 Hamming Code
Checksum
In this error detection scheme, the following procedure is applied.
Data is divided into fixed sized frames or segments.
The sender adds the segments using 1’s complement arithmetic to
get the sum. It then complements the sum to get the checksum
and sends it along with the data frames.
The receiver adds the incoming segments along with the
checksum using 1’s complement arithmetic to get the sum and
then complements it.
If the result is zero, the received frames are accepted; otherwise
they are discarded.
Cyclic Redundancy Check (CRC)

Cyclic Redundancy Check (CRC) involves binary division of the


data bits being sent by a predetermined divisor agreed upon by
the communicating system. The divisor is generated using
polynomials.
Here, the sender performs binary division of the data segment by
the divisor. It then appends the remainder called CRC bits to the
end of data segment. This makes the resulting data unit exactly
divisible by the divisor.
The receiver divides the incoming data unit by
the divisor. If there is no remainder, the data
unit is assumed to be correct and is accepted.
Otherwise, it is understood that the data is
corrupted and is therefore rejected.
Error correcting codes

Error correction codes − are used to correct the errors


present in the received data bitstream so that, we will
get the original data. ... Example − Hamming code.
Therefore, to detect and correct the errors, additional
bits are appended to the data bits at the time of
transmission.
Hamming Code:
R. W. Hamming developed a system that provides a methodical way
to add one or more parity bits to a data character in order to detect and
correct errors. The Hamming distance between two code words is
defined as the number of bits changed from one code word to another.
Consider, Ci and Cj to be any two code words in a particular block
code. The Hamming distance dij between the two vectors Ci and Cj is
defined by the number of components in which they differ. Assuming
that Dij is determined for each pair of code words, the minimum value
of the dij can be called the Hamming distance, dmin. For linear block
codes, minimum weight is equal to minimum distance.
For example,
Ci = 1 0 0 0 1 1 1

Cj = 0 0 0 1 0 1 1
Here, these code words differ in the leftmost bit position and in the
fourth and fifth bit positions from the left. Accordingly, d ij =3.
From Hamming’s analysis of code distances, the following important
properties have been derived:
 A minimum distance of at least two is required for single error
detection.
 Since the number of errors, E ≤[(dmin-1)/2], a minimum distance
of three is required for single error correction.
 Greater distances will provide detection and /or correction of
more number of errors.
The 7-bit Hamming (7, 4) code word h1h2 h3 h4 h5 h6 h7 associated with a
4-bit binary number b3 b2 b1 b0 is:

h3=b3
h5=b2

h6 =b1
h7=b0
Where denotes the Exclusive-OR operation. Note that bits h1, h2 and h4
are even parity bits for the bit fields b 3b2b0, b3b1b0 and b2b1b0
respectively. In general, the parity bits (h 1, h2, h4, h8,…….) are located in
the positions corresponding to ascending powers of two (i.e., 2 0, 21, 22,
23, ………..=1, 2, 4, 8, ………..)
The h1 parity bit has a 1 in the LSB of its binary representation.
Therefore, it checks all bit positions, including those which
have 1’s in the same location (i.e., LSB) in the binary
representation (i.e., h1, h3, h5 and h7). The binary representation
of h2, has a 1 in the middle bit. Therefore, it checks all bit
positions, including those which have 1’s in the same location
(i.e., middle bit) in the binary representation (i.e., h 2, h3, h6 and
h7). The binary representation of h 4 has a 1 in the MSB.
Therefore, it checks all bit positions, including those which
have 1’s in the same location (i.e., MSB) in the binary
representation (i.e., h4, h5, h6 and h7).
To decode a hamming code, one must check for odd parity over the
bit fields in which even parity was previously established. For
example, a single bit error is indicated by a non-zero parity word c 4,
c2, c1 where

If C4 C2 C1= 0 0 0, then there is no error in hamming code. If it has


a non-zero value, it indicates the bit position in error. For example,
if C4 C2 C1 = 101, then bit 5 is in error. To correct this error, bit 5
has to be complemented.
Encode data bits 0101 into a 7-bit even parity Hamming code

Solution: Given b3 b2 b1 b0 =0101.

=0 1 1=0
h3=b3 =0
=0 0 1=1
h5=b2 =1
=1 0 1=0 h6 =b1 =0
h7=b0 =1
h1 h2 h3 h4 h 5 h 6 h 7
0 1 0 0 1 0 1
A 7-bit Hamming code is received as 0101101. What is its correct
code?

Sol: h1 h2 h3 h4 h 5 h 6 h 7
0 1 0 1 1 0 1

=0 0 1+1 =0 0 0 1=0
1 0 1=1
Thus C4 C2 C1= 1 0 0. Therefore, bit 4 is in error and the
corrected code word can be obtained by complementing the
fourth bit in the received code word as 0100 101
Thank You

You might also like