SlideShare ist ein Scribd-Unternehmen logo
1 von 22
Error Detection and correction
Chapter 10
Data communication and networks
Type of errors
• Only one bit of a given data unit
is changed
• The least likely type of error in
serial transmission
• Single-bit error can happen in
parallel transmission
Burst Error
• Two or more bits in the data
unit have changed
• Burst error does not necessarily
mean that the errors occur in
consecutive bits
• Most likely to happen in a serial
transmission
• Number of bits affected
depends on the data rate and
duration of noise
Single-Bit Error
Redundancy
• Error detection uses the concept of redundancy, which means
adding extra (redundant) bits for detecting errors at the
destination
• These redundant bits are added by the sender and removed
by the receiver
Error control
• Detection VS Correction
 Detection: error ? yes or no
 Correction: Need to know the exact number of bits that are corrupted,
and their location in the message
• Forward Error Correction VS Retransmission( backward error correction)
 Forward error correction is the process in which the receiver tries to
guess the message by using redundant bits
 if the number of errors is small. Correction by retransmission is a
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
• In modulo-N arithmetic, we use only the integers in the range
0 to N-1, inclusive.
Block Coding
• Divide the message into blocks, each of k bits, called datawords.
• Add r redundant bits to each block to make the length n = k + r. The
resulting n-bit blocks are called codewords
• 2n - 2k codewords that are not used. We call these codewords invalid or
illegal
• we need more redundant bits for error correction than for error detection
• Example: 4B/5B block coding
– k = 4 and n = 5.
– 2k = 16 datawords and 2n = 32 codewords.
Error Detection
1. The receiver receives 011 which 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.
Error Correction
• The sender creates the codeword
01011. The codeword is corrupted
during transmission, and 01001 is
received. receiver finds an error has
occurred , assuming that there is only
1 bit corrupted .
• Comparing the received codeword
with the 1st codeword in the table
(01001 versus 00000), the receiver
decides that the 1st codeword is not
the one that was sent because there
are 2 different bits. (the same for 3rd
or 4th one in the table)
• The original codeword must be the
2nd one in the table because this is
the only one that differs from the
received codeword by 1 bit.
Error detection block diagram
Error correction block diagram
Hamming distance
• Hamming distance between two words x and y as d(x, y).
• The Hamming distance between two words is the number of differences
between corresponding bits .
• Example: Hamming distance d(10101, 11110) is 3
• The minimum Hamming distance is the smallest Hamming distance
between all possible pairs in a set of words .
• for below example dmin = 2
• Three parameters to define the coding schemes
– Codeword size n
– Dataword size k
– The minimum Hamming distance dmin
• Coding scheme C(n, k) with a separate expression for dmin
Hamming distance
• Minimum distance for error detection
 If ‘s’ errors occurs during transmission, the Hamming
distance between the sent codeword and received
codeword is ‘s’.
If our code is to detect up to ‘s’ errors, the minimum
distance between the valid codewords must be ‘s+1’, so
that the received codeword does not match a valid
codeword.
dmin = s + 1.
• Minimum Distance for Error Correction
 To guarantee correction of up to “t” errors in all cases, the
minimum Hamming distance in a block code must be
 dmin = 2t+ 1.
LINEAR BLOCK CODES
• In a linear block code, the exclusive OR (XOR) of any two valid codewords creates another
valid codeword .
• A simple parity-check code is a single-bit error-detecting code in which n =k + 1 with dmin
=2.
• The encoder uses a generator that takes a copy of a 4-bit dataword (ao, aI' a2' and a3) and
generates a parity bit roo The dataword bits and the parity bit create the 5-bit codeword.
The parity bit that is added makes the number of 1’s in the codeword even
r0=a3+a2+a1+a0
s0=b3+b2+b1+b0+q0
Different situations of occurrence of
error in linear block coding
• No error occurs; the received codeword is 10111. The syndrome is
0. The dataword 1011 is created.
• One single-bit error changes a1, The received codeword is 10011.
The syndrome is 1. No dataword is created.
• One single-bit error changes ro The received codeword is 10110.
The syndrome is 1. No dataword is created. Note that although
none of the dataword bits are corrupted, no dataword is created .
• An error changes ro and 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.
• Three bits- a3, a2, a1-are changed by errors. The received
codeword is 01011. The syndrome is 1. The dataword is not
created.
• A simple parity-check code can detect an odd number of errors.
Encoder and Decoder for Hamming Code
• To find relationship between n and k, we define m>=3, the values of n and k are
calculated as n = 2m − 1 and k=n-m. The number of check bits r=m.
• r0 = a2 + a1 + a0 modulo-2 s0 = b2 + b1 + b0 + q0 modulo-2
• r1 = a3 + a2 + a1 modulo-2 s1 = b3 + b2 + b1 + q1 modulo-2
• r2 = a1 + a0 + a3 modulo-2 s2 = b1 + b0 + b3 + q2 modulo-2
Burst Error Correction Using Hamming Code
Cyclic Redundancy Check (CRC)
Division in CRC Encoder
The generator uses a divisor of size
n - k + I (4 here), predefined and
agreed upon.
Division in CRC Decoder
Cyclic Code Analysis
• Dataword: d(x) Syndrome: s(x) Error: e(x)
Codeword: c(x) Generator: g(x)
• In a cyclic code,
1. If s(x)≠0, one or more bits is corrupted.
2. If s(x) =0, either
a. No bit is corrupted. or
b. Some bits are corrupted, but the decoder failed to detect them
• Received codeword =c(x) + e(x)
• (Received codeword)/g(x) = c(x)/g(x) + e(x)/g(x) = s(x)
• First term: no remainder
• Second term:
 if it is not equal to zero then there is some error
 If it is equal to zero that means, either e(x)=0 or e(x) is exactly divisible by
g(x) refers to no error scenario.
Cyclic Code Analysis
• In a cyclic code, those e(x) errors that are divisible by g(x) are not caught .
• If the generator g(x) has more than one term and the coefficient of X0 is 1,
all single errors can be caught.
• If a generator cannot divider “x^t+1” (t between 0 and n - 1), then all
isolated double errors can be detected.
• A generator that contains a factor of “x + 1” can detect all odd-numbered
errors.
• Burst error’s ( L == length of error ; r== no of check bits )
1. All burst errors with L <= r will be detected
2. All burst errors with L =r + 1 will be detected with
probability 1 - (1/2)^(r-1)
3. All burst errors with L > r + 1 will be detected with
probability 1-(1/2)^r
Example g(x) = x^14 + x^3 + 1 then r = 14
Checksum
• (7, 11, 12, 0, 6), we send (7, 11, 12,0,6,36),
where 36 is the sum of the original numbers .
• We send the negative (complement) of the
sum, called the checksum. In this case, we
send (7, 11, 12,0,6,-36).
• Complement of “x” = (2^n – 1) –x : n bit’s
Checksum: Example
• The sender initializes the checksum to 0 and adds all data items
and the checksum. However, 36 cannot be expressed in 4 bits. The
extra two bits are wrapped and added with the sum to create the
wrapped sum value 6. The sum is then complemented, resulting in
the checksum value 9 (15 − 6 = 9).
Internet Checksum
Example on internet check sum
DATA (32 bit) 10110011101010110101101011010101
Sender side
• 1011001110101011  seg 1
• 0101101011010101  seg 2
• 0000111010000000  seg1 +seg 2
• 1  carry
• 0000111010000001  sum
• 1111000101111110  checksum { 1’s complement of sum }
• Send the “ DATA + checksum “ to the receiver
Receiver side
• 1011001110101011  seg 1
• 0101101011010101  seg 2
• 1111000101111110  checksum
• 1111111111111110  seg 1 + seg 2 + checksum
• 1  carry
• 1111111111111111  sum’
• 0000000000000000  checksum’ { 1’s complement of sum’ }

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Chapter 10: Error Correction and Detection
Chapter 10: Error Correction and DetectionChapter 10: Error Correction and Detection
Chapter 10: Error Correction and Detection
 
Error detection and correction
Error detection and correctionError detection and correction
Error detection and correction
 
Network layer - design Issues
Network layer - design IssuesNetwork layer - design Issues
Network layer - design Issues
 
Framing in data link layer
Framing in data link layerFraming in data link layer
Framing in data link layer
 
Leaky Bucket & Tocken Bucket - Traffic shaping
Leaky Bucket & Tocken Bucket - Traffic shapingLeaky Bucket & Tocken Bucket - Traffic shaping
Leaky Bucket & Tocken Bucket - Traffic shaping
 
Error Detection And Correction
Error Detection And CorrectionError Detection And Correction
Error Detection And Correction
 
Media Access Control
Media Access ControlMedia Access Control
Media Access Control
 
Network Layer design Issues.pptx
Network Layer design Issues.pptxNetwork Layer design Issues.pptx
Network Layer design Issues.pptx
 
Block coding, error detection (Parity checking, Cyclic redundancy checking (C...
Block coding, error detection (Parity checking, Cyclic redundancy checking (C...Block coding, error detection (Parity checking, Cyclic redundancy checking (C...
Block coding, error detection (Parity checking, Cyclic redundancy checking (C...
 
Computer Networks - Error Detection & Error Correction
Computer Networks - Error Detection & Error CorrectionComputer Networks - Error Detection & Error Correction
Computer Networks - Error Detection & Error Correction
 
ELEMENTS OF TRANSPORT PROTOCOL
ELEMENTS OF TRANSPORT PROTOCOLELEMENTS OF TRANSPORT PROTOCOL
ELEMENTS OF TRANSPORT PROTOCOL
 
Error Detection and Correction presentation
Error Detection and Correction presentation Error Detection and Correction presentation
Error Detection and Correction presentation
 
Unit 2 data link control
Unit 2 data link controlUnit 2 data link control
Unit 2 data link control
 
Error Correction And Hamming Code Ibrar
Error Correction And Hamming Code IbrarError Correction And Hamming Code Ibrar
Error Correction And Hamming Code Ibrar
 
Congetion Control.pptx
Congetion Control.pptxCongetion Control.pptx
Congetion Control.pptx
 
Flow control in Computer Network
Flow control in Computer NetworkFlow control in Computer Network
Flow control in Computer Network
 
DCN Error Detection & Correction
DCN Error Detection & CorrectionDCN Error Detection & Correction
DCN Error Detection & Correction
 
Computer Network - Network Layer
Computer Network - Network LayerComputer Network - Network Layer
Computer Network - Network Layer
 
Transport layer
Transport layerTransport layer
Transport layer
 
Convolutional codes
Convolutional codesConvolutional codes
Convolutional codes
 

Ähnlich wie Error Detection and correction concepts in Data communication and networks

New error-detection
New error-detectionNew error-detection
New error-detection
Nitesh Singh
 
New error-detection (2)
New error-detection (2)New error-detection (2)
New error-detection (2)
Nitesh Singh
 
Computer Networks/Computer Engineering.pdf
Computer Networks/Computer Engineering.pdfComputer Networks/Computer Engineering.pdf
Computer Networks/Computer Engineering.pdf
abdnazar2003
 
Error detection.
Error detection.Error detection.
Error detection.
Wasim Akbar
 

Ähnlich wie Error Detection and correction concepts in Data communication and networks (20)

New error-detection
New error-detectionNew error-detection
New error-detection
 
New error-detection (2)
New error-detection (2)New error-detection (2)
New error-detection (2)
 
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
 
linear codes and cyclic codes
linear codes and cyclic codeslinear codes and cyclic codes
linear codes and cyclic codes
 
Chapter 10
Chapter 10Chapter 10
Chapter 10
 
Lecture8_Error Detection and Correction 232.pptx
Lecture8_Error Detection and Correction 232.pptxLecture8_Error Detection and Correction 232.pptx
Lecture8_Error Detection and Correction 232.pptx
 
3F4ecc.ppt
3F4ecc.ppt3F4ecc.ppt
3F4ecc.ppt
 
Computer Networks/Computer Engineering.pdf
Computer Networks/Computer Engineering.pdfComputer Networks/Computer Engineering.pdf
Computer Networks/Computer Engineering.pdf
 
Ch3 datalink
Ch3 datalinkCh3 datalink
Ch3 datalink
 
Error detection.
Error detection.Error detection.
Error detection.
 
Data links
Data links Data links
Data links
 
Unit-4.pptx
Unit-4.pptxUnit-4.pptx
Unit-4.pptx
 
Linear Block Codes
Linear Block CodesLinear Block Codes
Linear Block Codes
 
13-DataLink_02.ppt
13-DataLink_02.ppt13-DataLink_02.ppt
13-DataLink_02.ppt
 
Error detection and correction
Error detection and correctionError detection and correction
Error detection and correction
 
Data Link Layer| Error Detection
Data Link Layer| Error DetectionData Link Layer| Error Detection
Data Link Layer| Error Detection
 
Digital Communication: Channel Coding
Digital Communication: Channel CodingDigital Communication: Channel Coding
Digital Communication: Channel Coding
 
lect5.ppt
lect5.pptlect5.ppt
lect5.ppt
 
Satellite error detection and correction presentation
Satellite error detection and correction presentationSatellite error detection and correction presentation
Satellite error detection and correction presentation
 
Data linklayer
Data linklayerData linklayer
Data linklayer
 

Mehr von Nt Arvind

Mehr von Nt Arvind (10)

Quantitative Aptitude , Section-Arithmetic , Chapter-Percentages
Quantitative Aptitude , Section-Arithmetic , Chapter-PercentagesQuantitative Aptitude , Section-Arithmetic , Chapter-Percentages
Quantitative Aptitude , Section-Arithmetic , Chapter-Percentages
 
Introduction to Sequential circuits and flip flops
Introduction to Sequential circuits and flip flops Introduction to Sequential circuits and flip flops
Introduction to Sequential circuits and flip flops
 
Detail explanation about the HOQ ( House of quality ) concept in engineering ...
Detail explanation about the HOQ ( House of quality ) concept in engineering ...Detail explanation about the HOQ ( House of quality ) concept in engineering ...
Detail explanation about the HOQ ( House of quality ) concept in engineering ...
 
Philosophy and Introduction of Engineering Design
Philosophy and Introduction of Engineering Design Philosophy and Introduction of Engineering Design
Philosophy and Introduction of Engineering Design
 
Introduction of smart bus transportation project @ IICDC 2016-2017
Introduction of smart bus transportation project @ IICDC 2016-2017Introduction of smart bus transportation project @ IICDC 2016-2017
Introduction of smart bus transportation project @ IICDC 2016-2017
 
8051 development board project report
8051 development board project report8051 development board project report
8051 development board project report
 
Multiple access protocols in data communication networks
Multiple access protocols in data communication networksMultiple access protocols in data communication networks
Multiple access protocols in data communication networks
 
Different protocols for data communication networks
Different protocols for data communication networks Different protocols for data communication networks
Different protocols for data communication networks
 
Switching concepts Data communication and networks
Switching concepts Data communication and networksSwitching concepts Data communication and networks
Switching concepts Data communication and networks
 
Basics on different types operational amplifier (op-amp)
Basics on different types operational amplifier (op-amp)Basics on different types operational amplifier (op-amp)
Basics on different types operational amplifier (op-amp)
 

Kürzlich hochgeladen

Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
MateoGardella
 

Kürzlich hochgeladen (20)

SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 

Error Detection and correction concepts in Data communication and networks

  • 1. Error Detection and correction Chapter 10 Data communication and networks
  • 2. Type of errors • Only one bit of a given data unit is changed • The least likely type of error in serial transmission • Single-bit error can happen in parallel transmission Burst Error • Two or more bits in the data unit have changed • Burst error does not necessarily mean that the errors occur in consecutive bits • Most likely to happen in a serial transmission • Number of bits affected depends on the data rate and duration of noise Single-Bit Error
  • 3. Redundancy • Error detection uses the concept of redundancy, which means adding extra (redundant) bits for detecting errors at the destination • These redundant bits are added by the sender and removed by the receiver
  • 4. Error control • Detection VS Correction  Detection: error ? yes or no  Correction: Need to know the exact number of bits that are corrupted, and their location in the message • Forward Error Correction VS Retransmission( backward error correction)  Forward error correction is the process in which the receiver tries to guess the message by using redundant bits  if the number of errors is small. Correction by retransmission is a 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 • In modulo-N arithmetic, we use only the integers in the range 0 to N-1, inclusive.
  • 5. Block Coding • Divide the message into blocks, each of k bits, called datawords. • Add r redundant bits to each block to make the length n = k + r. The resulting n-bit blocks are called codewords • 2n - 2k codewords that are not used. We call these codewords invalid or illegal • we need more redundant bits for error correction than for error detection • Example: 4B/5B block coding – k = 4 and n = 5. – 2k = 16 datawords and 2n = 32 codewords.
  • 6. Error Detection 1. The receiver receives 011 which 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. Error Correction • The sender creates the codeword 01011. The codeword is corrupted during transmission, and 01001 is received. receiver finds an error has occurred , assuming that there is only 1 bit corrupted . • Comparing the received codeword with the 1st codeword in the table (01001 versus 00000), the receiver decides that the 1st codeword is not the one that was sent because there are 2 different bits. (the same for 3rd or 4th one in the table) • The original codeword must be the 2nd one in the table because this is the only one that differs from the received codeword by 1 bit.
  • 7. Error detection block diagram Error correction block diagram
  • 8. Hamming distance • Hamming distance between two words x and y as d(x, y). • The Hamming distance between two words is the number of differences between corresponding bits . • Example: Hamming distance d(10101, 11110) is 3 • The minimum Hamming distance is the smallest Hamming distance between all possible pairs in a set of words . • for below example dmin = 2 • Three parameters to define the coding schemes – Codeword size n – Dataword size k – The minimum Hamming distance dmin • Coding scheme C(n, k) with a separate expression for dmin
  • 9. Hamming distance • Minimum distance for error detection  If ‘s’ errors occurs during transmission, the Hamming distance between the sent codeword and received codeword is ‘s’. If our code is to detect up to ‘s’ errors, the minimum distance between the valid codewords must be ‘s+1’, so that the received codeword does not match a valid codeword. dmin = s + 1. • Minimum Distance for Error Correction  To guarantee correction of up to “t” errors in all cases, the minimum Hamming distance in a block code must be  dmin = 2t+ 1.
  • 10. LINEAR BLOCK CODES • In a linear block code, the exclusive OR (XOR) of any two valid codewords creates another valid codeword . • A simple parity-check code is a single-bit error-detecting code in which n =k + 1 with dmin =2. • The encoder uses a generator that takes a copy of a 4-bit dataword (ao, aI' a2' and a3) and generates a parity bit roo The dataword bits and the parity bit create the 5-bit codeword. The parity bit that is added makes the number of 1’s in the codeword even r0=a3+a2+a1+a0 s0=b3+b2+b1+b0+q0
  • 11. Different situations of occurrence of error in linear block coding • No error occurs; the received codeword is 10111. The syndrome is 0. The dataword 1011 is created. • One single-bit error changes a1, The received codeword is 10011. The syndrome is 1. No dataword is created. • One single-bit error changes ro The received codeword is 10110. The syndrome is 1. No dataword is created. Note that although none of the dataword bits are corrupted, no dataword is created . • An error changes ro and 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. • Three bits- a3, a2, a1-are changed by errors. The received codeword is 01011. The syndrome is 1. The dataword is not created. • A simple parity-check code can detect an odd number of errors.
  • 12. Encoder and Decoder for Hamming Code • To find relationship between n and k, we define m>=3, the values of n and k are calculated as n = 2m − 1 and k=n-m. The number of check bits r=m. • r0 = a2 + a1 + a0 modulo-2 s0 = b2 + b1 + b0 + q0 modulo-2 • r1 = a3 + a2 + a1 modulo-2 s1 = b3 + b2 + b1 + q1 modulo-2 • r2 = a1 + a0 + a3 modulo-2 s2 = b1 + b0 + b3 + q2 modulo-2
  • 13. Burst Error Correction Using Hamming Code
  • 15. Division in CRC Encoder The generator uses a divisor of size n - k + I (4 here), predefined and agreed upon.
  • 16. Division in CRC Decoder
  • 17. Cyclic Code Analysis • Dataword: d(x) Syndrome: s(x) Error: e(x) Codeword: c(x) Generator: g(x) • In a cyclic code, 1. If s(x)≠0, one or more bits is corrupted. 2. If s(x) =0, either a. No bit is corrupted. or b. Some bits are corrupted, but the decoder failed to detect them • Received codeword =c(x) + e(x) • (Received codeword)/g(x) = c(x)/g(x) + e(x)/g(x) = s(x) • First term: no remainder • Second term:  if it is not equal to zero then there is some error  If it is equal to zero that means, either e(x)=0 or e(x) is exactly divisible by g(x) refers to no error scenario.
  • 18. Cyclic Code Analysis • In a cyclic code, those e(x) errors that are divisible by g(x) are not caught . • If the generator g(x) has more than one term and the coefficient of X0 is 1, all single errors can be caught. • If a generator cannot divider “x^t+1” (t between 0 and n - 1), then all isolated double errors can be detected. • A generator that contains a factor of “x + 1” can detect all odd-numbered errors. • Burst error’s ( L == length of error ; r== no of check bits ) 1. All burst errors with L <= r will be detected 2. All burst errors with L =r + 1 will be detected with probability 1 - (1/2)^(r-1) 3. All burst errors with L > r + 1 will be detected with probability 1-(1/2)^r Example g(x) = x^14 + x^3 + 1 then r = 14
  • 19. Checksum • (7, 11, 12, 0, 6), we send (7, 11, 12,0,6,36), where 36 is the sum of the original numbers . • We send the negative (complement) of the sum, called the checksum. In this case, we send (7, 11, 12,0,6,-36). • Complement of “x” = (2^n – 1) –x : n bit’s
  • 20. Checksum: Example • The sender initializes the checksum to 0 and adds all data items and the checksum. However, 36 cannot be expressed in 4 bits. The extra two bits are wrapped and added with the sum to create the wrapped sum value 6. The sum is then complemented, resulting in the checksum value 9 (15 − 6 = 9).
  • 22. Example on internet check sum DATA (32 bit) 10110011101010110101101011010101 Sender side • 1011001110101011  seg 1 • 0101101011010101  seg 2 • 0000111010000000  seg1 +seg 2 • 1  carry • 0000111010000001  sum • 1111000101111110  checksum { 1’s complement of sum } • Send the “ DATA + checksum “ to the receiver Receiver side • 1011001110101011  seg 1 • 0101101011010101  seg 2 • 1111000101111110  checksum • 1111111111111110  seg 1 + seg 2 + checksum • 1  carry • 1111111111111111  sum’ • 0000000000000000  checksum’ { 1’s complement of sum’ }