SlideShare a Scribd company logo
1 of 63
Error Detection & Correction
Prepared by:
Risala Tasin Khan
Associate Professor
IIT, JU
Error Detection and Correction
10.1 Types of Errors
10.2 Detection
10.3 Error Correction
Error Detection and Correction
Data can be corrupted during transmission. For reliable
communication, error must be detected and corrected
Error Detection and Correction are implemented either at the data
link layer or the transport layer of the OSI model
10.1 Type of Errors
Type of Errors(cont’d)
• Single-Bit Error
~ is when only one bit in the data unit has changed (ex : ASCII
STX - ASCII LF)
Type of Errors(cont’d)
• Multiple-Bit Error
~ is when two or more nonconsecutive bits in the data unit have
changed(ex : ASCII B - ASCII LF)
Redundancy
• The central concept in detecting or correcting errors is redundancy.
• To be able to detect or correct errors, we need to send some extra
bits with our data.
• These redundant bits are added by the sender and removed by the
receiver.
• Their presence allows the receiver to detect or correct corrupted bits.
Detection(Redundancy)
• Redundancy
Detection Vs. Correction
• Error control process has two components: Error detection and error
correction.
• The correction of errors is more difficult than the detection.
• In error detection, we are looking only to see if any error has occurred. The
answer is a simple yes or no. We are not even interested in the number of
errors. A single-bit error is the same for us as burst error.
• In error correction, we need to know the exact number of bits that are
corrupted and more importantly, their location in the message. The number
of errors and the size of message are important factors.
• If we need to correct one single error in an 8-bit data unit, we need to
consider eight possible error locations; if we need to correct two errors in a
data unit of the same size, we need to consider 2C8 = 28 possibilities.
Forward Error Correction Vs. Retransmission
• Error correction can be handled in two ways:
(i) Forward error correction
(ii) Retransmission
• Forward error correction is a process of error correction in which the
receiver tries to guess the message by using redundant bits. This
method is used if the number of errors is small.
• Retransmission is a error correction technique in which the receiver
detects the occurrence of an error and asks the sender to resend the
message. Resending is repeated until a message arrives that the
receiver believes is error-free.
Coding
• Redundancy is achieved through various coding schemes.
• The sender adds redundant bits through a process that creates a
relationship between the redundant bits and the actual data bits.
• The receiver checks the relationships between the two sets of bits to
detect or correct the errors.
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.
10.13
Figure 10.5 Datawords and codewords in block coding
10.14
The 4B/5B block coding discussed in Chapter 4 is a good
example of this type of coding. In this coding scheme,
k = 4 and n = 5. As we saw, we have 2k = 16 datawords
and 2n = 32 codewords. We saw that 16 out of 32
codewords are used for message transfer and the rest are
either used for other purposes or unused.
Example 10.1
10.15
Error Detection using Block Coding
• Enough redundancy is added to detect an error.
• The receiver knows an error occurred but does not
know which bit(s) is(are) in error.
• Has less overhead than error correction.
10.16
Figure 10.6 Process of error detection in block coding
10.17
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 the following cases:
1. The receiver receives 011. It is a valid codeword. The
receiver extracts the dataword 01 from it.
2. The codeword is corrupted during transmission, and
111 is received. This is not a valid codeword and is
discarded.
3. The codeword is corrupted during transmission, and
000 is received. This is a valid codeword. The
receiver
incorrectly extracts the dataword 00.
Two corrupted bits have made the error undetectable.
Example 10.2
10.18
• Let us add more redundant bits to Example
10.2 to see if the receiver can correct an error
without knowing what was actually sent.
• We add 3 redundant bits to the 2-bit dataword
to make 5-bit codewords.
• Table 10.2 shows the datawords and
codewords.
• Assume the dataword is 01. The sender creates
the codeword 01011. The codeword is
corrupted during transmission, and 01001 is
received.
• First, the receiver finds that the received
codeword is not in the table. This means an
error has occurred. The receiver, assuming
that there is only 1 bit corrupted, uses the
following strategy to guess the correct
dataword.
Example 10.3
10.19
1. Comparing the received codeword with the first
codeword in the table (01001 versus 00000), the
receiver decides that the first codeword is not the one
that was sent because there are two different bits.
2. By the same reasoning, the original codeword cannot be
the third or fourth one in the table.
3. The original codeword must be the second one in the
table because this is the only one that differs from the
received codeword by 1 bit. The receiver replaces 01001
with 01011 and consults the table to find the dataword
01.
Example 10.3 (continued)
Hamming Distance
10.
The Hamming distance between two
words is the number of differences
between corresponding bits.
Note
10.
Let us find the Hamming distance between two pairs of
words.
1. The Hamming distance d(000, 011) is 2 because
Example 10.4
2. The Hamming distance d(10101, 11110) is 3 because
10.
The minimum Hamming distance is the
smallest Hamming distance between
all possible pairs in a set of words.
Note
10.
Find the minimum Hamming distance of the coding
scheme in Table 10.1.
Solution
We first find all Hamming distances.
Example 10.5
The dmin in this case is 2.
10.
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.
Example 10.6
10.
To guarantee the detection of up to s
errors in all cases, the minimum
Hamming distance in a block
code must be dmin = s + 1.
Note
10.
The minimum Hamming distance for our first code
scheme (Table 10.1) is 2. This code guarantees detection of
only a single error. For example, if the third codeword
(101) is sent and one error occurs, the received codeword
does not match any valid codeword. If two errors occur,
however, the received codeword may match a valid
codeword and the errors are not detected.
Example 10.7
10.
Our second block code scheme (Table 10.2) has dmin = 3.
This code can detect up to two errors. Again, we see that
when any of the valid codewords is sent, two errors create
a codeword which is not in the table of valid codewords.
The receiver cannot be fooled.
However, some combinations of three errors change a
valid codeword to another valid codeword. The receiver
accepts the received codeword and the errors are
undetected.
Example 10.8
10.
10-3 LINEAR BLOCK CODES
Almost all block codes used today belong to a subset
called linear block codes. A linear block code is a code
in which the exclusive OR (addition modulo-2) of two
valid codewords creates another valid codeword.
Minimum Distance for Linear Block Codes
Some Linear Block Codes
Topics discussed in this section:
10.
Let us see if the two codes we defined in Table 10.1 and
Table 10.2 belong to the class of linear block codes.
1. The scheme in Table 10.1 is a linear block code
because the result of XORing any codeword with any
other codeword is a valid codeword. For example, the
XORing of the second and third codewords creates the
fourth one.
2. The scheme in Table 10.2 is also a linear block code.
We can create all four codewords by XORing two
other codewords.
Example 10.10
Simple Parity Check Code
• In this code, a k-bit dataword is changed to an n-bit codeword where
n = k + 1.
• The extra bit, called the parity bit, is selected to make the total
number of 1s in the codeword even.
• The minimum Hamming distance for this category is dmin =2, which
means that the code is a single-bit error-detecting code; it cannot
correct any error.
10.
A simple parity-check code is a
single-bit error-detecting
code in which
n = k + 1 with dmin = 2.
Even parity (ensures that a codeword
has an even number of 1’s) and odd
parity (ensures that there are an odd
number of 1’s in the codeword)
Note
10.
Table 10.3 Simple parity-check code C(5, 4)
10.
Figure 10.10 Encoder and decoder for simple parity-check code
10.
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 10.12
10.
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.
Example 10.12 (continued)
10.
A simple parity-check code can detect an
odd number of errors.
Note
Different Parity Check Method
• Two variations on the parity bit mechanism are horizontal
redundancy checks (HRC), vertical redundancy checks (VRC).
• Vertical Redundancy Check (VRC):
• VRC is also known as Parity Check
– Append a single bit (i.e. parity bit, either a 0 or a 1) at the end of data block
such that the total number of 1s including parity bit is even for even parity or
odd for odd parity check.
Different Parity Check Method (Cont..)
• Longitudinal Redundancy Check (LRC)
– LRC was developed to overcome the problem with low probability of
detecting errors in parity method.
– It organizes data into a table and creates parity for each column.
– Parity bits of all positions are assembled into a new data unit called BCC
(block check character), which is added to the end of the data block.
Example (LRC)
• Suppose we want to send the message snow using even parity and
LRC with 7- bit ASCII.
At first we determine the even parity of each character.
Example (LRC)
Two-dimensional parity-check code
• Another simple approach based on parity checks is to arrange the
string of data bits into a two-dimensional array and append a parity
bit to each row and column of data bits and an additional parity bit in
the lower-right corner, as shown in the following figure.
10.
Figure 10.11 Two-dimensional parity-check code
Four, 7-bit bytes are put in separate rows and for each row and column, 1 parity-check bit is
calculated.
The whole table is sent to the receiver, which finds the syndrome for each row and each column
10.
Figure 10.11 Two-dimensional parity-check code
10.
Figure 10.11 Two-dimensional parity-check code
10.
All Hamming codes discussed in this
book have dmin = 3 (2 bit error detection
and single bit error correction).
A codeword consists of n bits of which k
are data bits and r are check bits.
Let m = r, then we have: n = 2m -1
and k = n-m
For example, if m =3, then n ::: 7 and k::: 4.
This is a Hamming code C(7, 4) with dmin =3.
Note
10.
Table 10.4 Hamming code C(7, 4) - n=7, k = 4
10.
Modulo 2 arithmetic:
r0 = a2 + a1 + a0
r1 = a3 + a2 + a1
r2 = a1 + a0 + a3
Calculating the parity bits at the transmitter
:
Calculating the syndrome at the receiver:
s0 = b2 + b1 + b0
s1 = b3 + b2 + b1
s2 = b1 + b0 + b3
10.
Figure 10.12 The structure of the encoder and decoder for a Hamming code
10.
Table 10.5 Logical decision made by the correction logic analyzer
• The 3-bit syndrome creates eight different bit patterns (000 to 111) that can represent eight different conditions.
• This conditions define a lack of error or an error in 1 of the 7 bits of the received codeword as shown in table: 10.5
• Here, the generator is not concerned with the four cases shaded in the table as there is either no error or an error in
the parity bit.
• In other four cases, one of the bits must be flipped to find the correct dataword.
10.
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 received codeword is: 0011001. 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.
Example 10.13
Cyclic Code
• Cyclic codes are special linear block codes with one extra property.
In a cyclic code, if a codeword is cyclically shifted (rotated), the
result is another codeword.
Cyclic redundancy check (CRC)
• This Cyclic Redundancy Check is the most powerful and easy to implement
technique.
• In CRC, a sequence of redundant bits, called cyclic redundancy check bits,
are appended to the end of data unit so that the resulting data unit
becomes exactly divisible by a second, predetermined binary number.
• At the destination, the incoming data unit is divided by the same number.
• If at this step there is no remainder, the data unit is assumed to be correct
and is therefore accepted.
• A remainder indicates that the data unit has been damaged in transit and
therefore must be rejected
10.
Table 10.6 A CRC code with C(7, 4)
10.
Figure 10.14 CRC encoder and decoder
10.
Figure 10.15 Division in CRC encoder
10.
Figure 10.16 Division in the CRC decoder for two cases
Using Polynomials
• We can use a polynomial to represent a binary word.
• Each bit from right to left is mapped onto a power term.
• The rightmost bit represents the “0” power term. The bit next to it the “1” power term, etc.
• If the bit is of value zero, the power term is deleted from the expression.
• Here, the power of each term shows the position of the bit and the coefficient shows the
values of the bit.
• For example, if binary pattern is 100101, its corresponding polynomial representation is x5 +
x2 + 1.
• The benefits of using polynomial codes is that it produces short codes. For example here a 6-bit
pattern is replaced by 3 terms.
• In polynomial codes, the degree is 1 less than the number of bits in the binary pattern. The
degree of polynomial is the highest power in polynomial.
• For example as shown in fig degree of polynomial x5+x2 + 1 are 5. The bit pattern in this case is
6.
10.
Figure 10.21 A polynomial to represent a binary word
Polynomial Arithmetic
• Addition or subtraction is .done by combining terms and deleting pairs of
identical terms. For example adding x5 + x4 + x2 and x6 + x4 + x2 give x6 + x5. The
terms x4 and x2 are deleted.
• If three polynomials are to be added and if we get a same term three times, a
pair of them is detected and the third term is kept. For example, if there is
x2 three times then we keep only one x2
• In case of multiplication of two polynomials, their powers are added. For
example, multiplying x5 + x3 + x2 + x with x2+ x+ 1 yields:
• (X5 + x3 + x2 + x) (x2 + x + 1)
= x7 + x6+ x5+ x5+ x4+ x3+ x4+ x3+ x2+ x3+ x2+ x
=X7+x6+x3+X
• In case of division, the two polynomials are divided as per the rules of binary
division, until the degree of dividend is less than that of divisor.
10.
Figure 10.22 CRC division using polynomials
10.
The divisor in a cyclic code is normally
called the generator polynomial
or simply the generator.
Note

More Related Content

Similar to Lecture8_Error Detection and Correction 232.pptx

Error Detection and Correction
Error Detection and CorrectionError Detection and Correction
Error Detection and CorrectionTechiNerd
 
DCN Slides ch10 Error Detection and Correction.ppt
DCN Slides ch10 Error Detection and Correction.pptDCN Slides ch10 Error Detection and Correction.ppt
DCN Slides ch10 Error Detection and Correction.pptBilal Munir Mughal
 
Error_Detection_and_correction.ppt
Error_Detection_and_correction.pptError_Detection_and_correction.ppt
Error_Detection_and_correction.pptKashfUlHuda1
 
Computer Networks/Computer Engineering.pdf
Computer Networks/Computer Engineering.pdfComputer Networks/Computer Engineering.pdf
Computer Networks/Computer Engineering.pdfabdnazar2003
 
error detection correction
error detection correctionerror detection correction
error detection correctionBishalWosti1
 
SYBSC IT COMPUTER NETWORKS UNIT II Error Detection and Correction
SYBSC IT COMPUTER NETWORKS UNIT II Error Detection and CorrectionSYBSC IT COMPUTER NETWORKS UNIT II Error Detection and Correction
SYBSC IT COMPUTER NETWORKS UNIT II Error Detection and CorrectionArti Parab Academics
 
4_Datalink__Error_Detection_and Correction.pdf
4_Datalink__Error_Detection_and Correction.pdf4_Datalink__Error_Detection_and Correction.pdf
4_Datalink__Error_Detection_and Correction.pdfkenilpatel65
 
Data Communication And Networking - ERROR DETECTION AND CORRECTION
Data Communication And Networking - ERROR DETECTION AND CORRECTIONData Communication And Networking - ERROR DETECTION AND CORRECTION
Data Communication And Networking - ERROR DETECTION AND CORRECTIONAvijeet Negel
 
5(1)crc-chechsum-hamming.ppt
5(1)crc-chechsum-hamming.ppt5(1)crc-chechsum-hamming.ppt
5(1)crc-chechsum-hamming.pptprashant513130
 
hamming code detailed
hamming code detailedhamming code detailed
hamming code detailedIKhait
 

Similar to Lecture8_Error Detection and Correction 232.pptx (20)

Error Detection and Correction
Error Detection and CorrectionError Detection and Correction
Error Detection and Correction
 
DCN Slides ch10 Error Detection and Correction.ppt
DCN Slides ch10 Error Detection and Correction.pptDCN Slides ch10 Error Detection and Correction.ppt
DCN Slides ch10 Error Detection and Correction.ppt
 
Error_Detection_and_correction.ppt
Error_Detection_and_correction.pptError_Detection_and_correction.ppt
Error_Detection_and_correction.ppt
 
ch10.pdf
ch10.pdfch10.pdf
ch10.pdf
 
Chapter 10
Chapter 10Chapter 10
Chapter 10
 
Computer Networks/Computer Engineering.pdf
Computer Networks/Computer Engineering.pdfComputer Networks/Computer Engineering.pdf
Computer Networks/Computer Engineering.pdf
 
error detection correction
error detection correctionerror detection correction
error detection correction
 
SYBSC IT COMPUTER NETWORKS UNIT II Error Detection and Correction
SYBSC IT COMPUTER NETWORKS UNIT II Error Detection and CorrectionSYBSC IT COMPUTER NETWORKS UNIT II Error Detection and Correction
SYBSC IT COMPUTER NETWORKS UNIT II Error Detection and Correction
 
4_Datalink__Error_Detection_and Correction.pdf
4_Datalink__Error_Detection_and Correction.pdf4_Datalink__Error_Detection_and Correction.pdf
4_Datalink__Error_Detection_and Correction.pdf
 
ch10.ppt
ch10.pptch10.ppt
ch10.ppt
 
ch10.pdf
ch10.pdfch10.pdf
ch10.pdf
 
Ch10 1 v1
Ch10 1 v1Ch10 1 v1
Ch10 1 v1
 
Data Communication And Networking - ERROR DETECTION AND CORRECTION
Data Communication And Networking - ERROR DETECTION AND CORRECTIONData Communication And Networking - ERROR DETECTION AND CORRECTION
Data Communication And Networking - ERROR DETECTION AND CORRECTION
 
Ch10 1 v1
Ch10 1 v1Ch10 1 v1
Ch10 1 v1
 
5(1)crc-chechsum-hamming.ppt
5(1)crc-chechsum-hamming.ppt5(1)crc-chechsum-hamming.ppt
5(1)crc-chechsum-hamming.ppt
 
hamming code detailed
hamming code detailedhamming code detailed
hamming code detailed
 
ch10_2_v1.ppt
ch10_2_v1.pptch10_2_v1.ppt
ch10_2_v1.ppt
 
ch10_2_v1.ppt
ch10_2_v1.pptch10_2_v1.ppt
ch10_2_v1.ppt
 
ch10_2_v1.ppt
ch10_2_v1.pptch10_2_v1.ppt
ch10_2_v1.ppt
 
ch10_2_v1.ppt
ch10_2_v1.pptch10_2_v1.ppt
ch10_2_v1.ppt
 

Recently uploaded

Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 

Recently uploaded (20)

Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 

Lecture8_Error Detection and Correction 232.pptx

  • 1. Error Detection & Correction Prepared by: Risala Tasin Khan Associate Professor IIT, JU
  • 2. Error Detection and Correction 10.1 Types of Errors 10.2 Detection 10.3 Error Correction
  • 3. Error Detection and Correction Data can be corrupted during transmission. For reliable communication, error must be detected and corrected Error Detection and Correction are implemented either at the data link layer or the transport layer of the OSI model
  • 4. 10.1 Type of Errors
  • 5. Type of Errors(cont’d) • Single-Bit Error ~ is when only one bit in the data unit has changed (ex : ASCII STX - ASCII LF)
  • 6. Type of Errors(cont’d) • Multiple-Bit Error ~ is when two or more nonconsecutive bits in the data unit have changed(ex : ASCII B - ASCII LF)
  • 7. Redundancy • The central concept in detecting or correcting errors is redundancy. • To be able to detect or correct errors, we need to send some extra bits with our data. • These redundant bits are added by the sender and removed by the receiver. • Their presence allows the receiver to detect or correct corrupted bits.
  • 9. Detection Vs. Correction • Error control process has two components: Error detection and error correction. • The correction of errors is more difficult than the detection. • In error detection, we are looking only to see if any error has occurred. The answer is a simple yes or no. We are not even interested in the number of errors. A single-bit error is the same for us as burst error. • In error correction, we need to know the exact number of bits that are corrupted and more importantly, their location in the message. The number of errors and the size of message are important factors. • If we need to correct one single error in an 8-bit data unit, we need to consider eight possible error locations; if we need to correct two errors in a data unit of the same size, we need to consider 2C8 = 28 possibilities.
  • 10. Forward Error Correction Vs. Retransmission • Error correction can be handled in two ways: (i) Forward error correction (ii) Retransmission • Forward error correction is a process of error correction in which the receiver tries to guess the message by using redundant bits. This method is used if the number of errors is small. • Retransmission is a error correction technique in which the receiver detects the occurrence of an error and asks the sender to resend the message. Resending is repeated until a message arrives that the receiver believes is error-free.
  • 11. Coding • Redundancy is achieved through various coding schemes. • The sender adds redundant bits through a process that creates a relationship between the redundant bits and the actual data bits. • The receiver checks the relationships between the two sets of bits to detect or correct the errors.
  • 12. 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.
  • 13. 10.13 Figure 10.5 Datawords and codewords in block coding
  • 14. 10.14 The 4B/5B block coding discussed in Chapter 4 is a good example of this type of coding. In this coding scheme, k = 4 and n = 5. As we saw, we have 2k = 16 datawords and 2n = 32 codewords. We saw that 16 out of 32 codewords are used for message transfer and the rest are either used for other purposes or unused. Example 10.1
  • 15. 10.15 Error Detection using Block Coding • Enough redundancy is added to detect an error. • The receiver knows an error occurred but does not know which bit(s) is(are) in error. • Has less overhead than error correction.
  • 16. 10.16 Figure 10.6 Process of error detection in block coding
  • 17. 10.17 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 the following cases: 1. The receiver receives 011. It is a valid codeword. The receiver extracts the dataword 01 from it. 2. The codeword is corrupted during transmission, and 111 is received. This is not a valid codeword and is discarded. 3. The codeword is corrupted during transmission, and 000 is received. This is a valid codeword. The receiver incorrectly extracts the dataword 00. Two corrupted bits have made the error undetectable. Example 10.2
  • 18. 10.18 • Let us add more redundant bits to Example 10.2 to see if the receiver can correct an error without knowing what was actually sent. • We add 3 redundant bits to the 2-bit dataword to make 5-bit codewords. • Table 10.2 shows the datawords and codewords. • Assume the dataword is 01. The sender creates the codeword 01011. The codeword is corrupted during transmission, and 01001 is received. • First, the receiver finds that the received codeword is not in the table. This means an error has occurred. The receiver, assuming that there is only 1 bit corrupted, uses the following strategy to guess the correct dataword. Example 10.3
  • 19. 10.19 1. Comparing the received codeword with the first codeword in the table (01001 versus 00000), the receiver decides that the first codeword is not the one that was sent because there are two different bits. 2. By the same reasoning, the original codeword cannot be the third or fourth one in the table. 3. The original codeword must be the second one in the table because this is the only one that differs from the received codeword by 1 bit. The receiver replaces 01001 with 01011 and consults the table to find the dataword 01. Example 10.3 (continued)
  • 21. 10. The Hamming distance between two words is the number of differences between corresponding bits. Note
  • 22. 10. Let us find the Hamming distance between two pairs of words. 1. The Hamming distance d(000, 011) is 2 because Example 10.4 2. The Hamming distance d(10101, 11110) is 3 because
  • 23. 10. The minimum Hamming distance is the smallest Hamming distance between all possible pairs in a set of words. Note
  • 24. 10. Find the minimum Hamming distance of the coding scheme in Table 10.1. Solution We first find all Hamming distances. Example 10.5 The dmin in this case is 2.
  • 25. 10. 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. Example 10.6
  • 26. 10. To guarantee the detection of up to s errors in all cases, the minimum Hamming distance in a block code must be dmin = s + 1. Note
  • 27. 10. The minimum Hamming distance for our first code scheme (Table 10.1) is 2. This code guarantees detection of only a single error. For example, if the third codeword (101) is sent and one error occurs, the received codeword does not match any valid codeword. If two errors occur, however, the received codeword may match a valid codeword and the errors are not detected. Example 10.7
  • 28. 10. Our second block code scheme (Table 10.2) has dmin = 3. This code can detect up to two errors. Again, we see that when any of the valid codewords is sent, two errors create a codeword which is not in the table of valid codewords. The receiver cannot be fooled. However, some combinations of three errors change a valid codeword to another valid codeword. The receiver accepts the received codeword and the errors are undetected. Example 10.8
  • 29. 10. 10-3 LINEAR BLOCK CODES Almost all block codes used today belong to a subset called linear block codes. A linear block code is a code in which the exclusive OR (addition modulo-2) of two valid codewords creates another valid codeword. Minimum Distance for Linear Block Codes Some Linear Block Codes Topics discussed in this section:
  • 30. 10. Let us see if the two codes we defined in Table 10.1 and Table 10.2 belong to the class of linear block codes. 1. The scheme in Table 10.1 is a linear block code because the result of XORing any codeword with any other codeword is a valid codeword. For example, the XORing of the second and third codewords creates the fourth one. 2. The scheme in Table 10.2 is also a linear block code. We can create all four codewords by XORing two other codewords. Example 10.10
  • 31.
  • 32. Simple Parity Check Code • In this code, a k-bit dataword is changed to an n-bit codeword where n = k + 1. • The extra bit, called the parity bit, is selected to make the total number of 1s in the codeword even. • The minimum Hamming distance for this category is dmin =2, which means that the code is a single-bit error-detecting code; it cannot correct any error.
  • 33. 10. A simple parity-check code is a single-bit error-detecting code in which n = k + 1 with dmin = 2. Even parity (ensures that a codeword has an even number of 1’s) and odd parity (ensures that there are an odd number of 1’s in the codeword) Note
  • 34. 10. Table 10.3 Simple parity-check code C(5, 4)
  • 35. 10. Figure 10.10 Encoder and decoder for simple parity-check code
  • 36. 10. 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 10.12
  • 37. 10. 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. Example 10.12 (continued)
  • 38. 10. A simple parity-check code can detect an odd number of errors. Note
  • 39. Different Parity Check Method • Two variations on the parity bit mechanism are horizontal redundancy checks (HRC), vertical redundancy checks (VRC). • Vertical Redundancy Check (VRC): • VRC is also known as Parity Check – Append a single bit (i.e. parity bit, either a 0 or a 1) at the end of data block such that the total number of 1s including parity bit is even for even parity or odd for odd parity check.
  • 40. Different Parity Check Method (Cont..) • Longitudinal Redundancy Check (LRC) – LRC was developed to overcome the problem with low probability of detecting errors in parity method. – It organizes data into a table and creates parity for each column. – Parity bits of all positions are assembled into a new data unit called BCC (block check character), which is added to the end of the data block.
  • 41. Example (LRC) • Suppose we want to send the message snow using even parity and LRC with 7- bit ASCII. At first we determine the even parity of each character.
  • 43. Two-dimensional parity-check code • Another simple approach based on parity checks is to arrange the string of data bits into a two-dimensional array and append a parity bit to each row and column of data bits and an additional parity bit in the lower-right corner, as shown in the following figure.
  • 44. 10. Figure 10.11 Two-dimensional parity-check code Four, 7-bit bytes are put in separate rows and for each row and column, 1 parity-check bit is calculated. The whole table is sent to the receiver, which finds the syndrome for each row and each column
  • 45. 10. Figure 10.11 Two-dimensional parity-check code
  • 46. 10. Figure 10.11 Two-dimensional parity-check code
  • 47. 10. All Hamming codes discussed in this book have dmin = 3 (2 bit error detection and single bit error correction). A codeword consists of n bits of which k are data bits and r are check bits. Let m = r, then we have: n = 2m -1 and k = n-m For example, if m =3, then n ::: 7 and k::: 4. This is a Hamming code C(7, 4) with dmin =3. Note
  • 48. 10. Table 10.4 Hamming code C(7, 4) - n=7, k = 4
  • 49. 10. Modulo 2 arithmetic: r0 = a2 + a1 + a0 r1 = a3 + a2 + a1 r2 = a1 + a0 + a3 Calculating the parity bits at the transmitter : Calculating the syndrome at the receiver: s0 = b2 + b1 + b0 s1 = b3 + b2 + b1 s2 = b1 + b0 + b3
  • 50. 10. Figure 10.12 The structure of the encoder and decoder for a Hamming code
  • 51. 10. Table 10.5 Logical decision made by the correction logic analyzer • The 3-bit syndrome creates eight different bit patterns (000 to 111) that can represent eight different conditions. • This conditions define a lack of error or an error in 1 of the 7 bits of the received codeword as shown in table: 10.5 • Here, the generator is not concerned with the four cases shaded in the table as there is either no error or an error in the parity bit. • In other four cases, one of the bits must be flipped to find the correct dataword.
  • 52. 10. 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 received codeword is: 0011001. 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. Example 10.13
  • 53. Cyclic Code • Cyclic codes are special linear block codes with one extra property. In a cyclic code, if a codeword is cyclically shifted (rotated), the result is another codeword.
  • 54. Cyclic redundancy check (CRC) • This Cyclic Redundancy Check is the most powerful and easy to implement technique. • In CRC, a sequence of redundant bits, called cyclic redundancy check bits, are appended to the end of data unit so that the resulting data unit becomes exactly divisible by a second, predetermined binary number. • At the destination, the incoming data unit is divided by the same number. • If at this step there is no remainder, the data unit is assumed to be correct and is therefore accepted. • A remainder indicates that the data unit has been damaged in transit and therefore must be rejected
  • 55. 10. Table 10.6 A CRC code with C(7, 4)
  • 56. 10. Figure 10.14 CRC encoder and decoder
  • 57. 10. Figure 10.15 Division in CRC encoder
  • 58. 10. Figure 10.16 Division in the CRC decoder for two cases
  • 59. Using Polynomials • We can use a polynomial to represent a binary word. • Each bit from right to left is mapped onto a power term. • The rightmost bit represents the “0” power term. The bit next to it the “1” power term, etc. • If the bit is of value zero, the power term is deleted from the expression. • Here, the power of each term shows the position of the bit and the coefficient shows the values of the bit. • For example, if binary pattern is 100101, its corresponding polynomial representation is x5 + x2 + 1. • The benefits of using polynomial codes is that it produces short codes. For example here a 6-bit pattern is replaced by 3 terms. • In polynomial codes, the degree is 1 less than the number of bits in the binary pattern. The degree of polynomial is the highest power in polynomial. • For example as shown in fig degree of polynomial x5+x2 + 1 are 5. The bit pattern in this case is 6.
  • 60. 10. Figure 10.21 A polynomial to represent a binary word
  • 61. Polynomial Arithmetic • Addition or subtraction is .done by combining terms and deleting pairs of identical terms. For example adding x5 + x4 + x2 and x6 + x4 + x2 give x6 + x5. The terms x4 and x2 are deleted. • If three polynomials are to be added and if we get a same term three times, a pair of them is detected and the third term is kept. For example, if there is x2 three times then we keep only one x2 • In case of multiplication of two polynomials, their powers are added. For example, multiplying x5 + x3 + x2 + x with x2+ x+ 1 yields: • (X5 + x3 + x2 + x) (x2 + x + 1) = x7 + x6+ x5+ x5+ x4+ x3+ x4+ x3+ x2+ x3+ x2+ x =X7+x6+x3+X • In case of division, the two polynomials are divided as per the rules of binary division, until the degree of dividend is less than that of divisor.
  • 62. 10. Figure 10.22 CRC division using polynomials
  • 63. 10. The divisor in a cyclic code is normally called the generator polynomial or simply the generator. Note