Post on 10-May-2015
MSRIT INFORMATION SCIENCE 1
ERROR DETECTION&
ERROR CORRECTION
MSRIT INFORMATION SCIENCE 2
AMAK
A-> ANKITA (1MS07IS133)
M-> MAYANK (1MS07IS047)
A-> ANSHUJ (1MS07IS011)
K-> KRISH (1MS07IS038)
MSRIT INFORMATION SCIENCE 3
INTRODUCTION TO ERROR
REDUNDANCY
CODING
• LINEAR BLOCK CODING
• HAMMING CODE
• CYCLIC REDUNDANCY CHECK(CRC)
• IMPLEMENTATION OF HAMMING CODE
TABLE OF CONTENTS:
MSRIT INFORMATION SCIENCE 4
What is an error???Unpredictable change of bits from 1->0 or 0-
>1.
Typeso Single bit erroro Burst error(Multiple)
Redundancy: Correction or detection of errors.
INTRODUCTION
MSRIT INFORMATION SCIENCE 5
Forward error correction: Method of Guessing the actual message using the redundant bits.
Retransmission: Repeated sending of message until error free.
Modulo Arithmetic:• Modulo 2- Remainder after division can be either 0 or1.• Modulo 3- Remainder after division can be either 0,1 or
2....
• Modulo n- Remainder after division can be either 0,1,2….n-1.
MSRIT INFORMATION SCIENCE 6
Adding : 0+0=0 0+1=1 1+0=1 1+1=0
Subt: 0-0=0 0-1=1 1-0=1 1-1=0
XOR operation:
1 0 1 1 0 1 1 1 0 0 0 1 0 1 0
MSRIT INFORMATION SCIENCE 7
CODING: Redundancy is achieved through coding.
BLOCK CODING: Message divided into blocks.
• k bit datawords• r redundant bits• n= k+r, n>k,n bit codeword. • 2k total datawords(equal to number of
valid codewords.)• 2n total codewords• 2n -2k invalid codewords
MSRIT INFORMATION SCIENCE 8
ERROR DETECTIONo If resulting codeword is invalid.o If multiple errors in the codeword result in
valid codeword.
ERROR CORRECTIONo More difficult.o Need more number of redundant bits than
for detection.o Involves error detection as well as finding
the position(s) where error has occurred.
MSRIT INFORMATION SCIENCE 9
Generation of codewords for each dataword: C(7,4) n ,k
Codeword is generated by the generator which appends 3 redundant bits at the end of the dataword.
Ro =a2 + a1 + a0 Modulo-2
R1= a3 + a2 + a1 Modulo-2
R2= a1+ a0 + a3 Modulo-2
HAMMING CODE GENERATION
MSRIT INFORMATION SCIENCE 10
DATAWORD
CODEWORD
DATAWORD
CODEWORD
0000 0000000 1000 1000110
0001 0001101 1001 1001011
0010 0010111 1010 1010001
0011 0011010 1011 1011100
0100 0100011 1100 1100101
0101 0101110 1101 1101000
0110 0110100 1110 1110010
0111 0111001 1111 1111111
A CRC CODE WITH C(7,4)
MSRIT INFORMATION SCIENCE 11
checker on the receiver side will generate a 3bit syndrome by the formulae given below:
s0 = b2 + b1 + b0 + q0 modulo-2
s1 = b3 + b2 + b1 + q1 modulo-2
s2 = b1 + b0 + b3 + q2 modulo-2
If the syndrome i.e s2s1s0 is 000 then data is error free…or undetected.
Otherwise, received codeword has an error(s).
MSRIT INFORMATION SCIENCE 12
MAGIC TABLE
Depending upon the value of syndrome we can find the position of occurrence of error and then the bit position where error has occurred is flipped.
SYNDROME
000 001 010 011 100 101 110 111
ERROR None
q0 q1 b2 q2 b0 b3 b1
MSRIT INFORMATION SCIENCE 13
CODEWORD NOTATION ON SENDER’S AND RECEIVER’S SIDE
a3 a2 a1 a0 R2 R1 R0
b3 b2 b1 b0 q2 q1 q0
RECEIVED CODEWORD
0 1 0 1 0 0 0
CODEWORD SENT
1 1 0 1 0 0 0
MSRIT INFORMATION SCIENCE 14
Number of bit change occurring between two codewords.
0 1 1 1 0 1 01 0 1 1 1 1 1
0 1 0 0 1 0 1
The total number of ones is equal to the number
of bit changes between two codewords.
HAMMING DISTANCE
MSRIT INFORMATION SCIENCE 15
Smallest Hamming Distance between all sets of codewords.
Ex- d(0000000,0001101) = 3d(0001100,0111001) = 4d(0110100,0111001) =3d(11111111,0000000) =7…. & so on..
Dmin= 3 for the above set of codewords.
MINIMUM HAMMING DISTANCE
MSRIT INFORMATION SCIENCE 16
Suppose ‘s’ errors are to be detected, then dmin should be s+1.
for the example taken, it can detect upto a maximum of 2 errors.
Suppose ‘t’ errors are to be corrected, then the dmin should be 2t+1.
in the above example, it can correct upto only 1 error.
MSRIT INFORMATION SCIENCE 17
Linear block code?
Linear block code with an extra property: code word is cyclically rotated that generates another codeword.
1010110 is a codeword on rotating 0101101 which is another codeword.
CYCLIC CODE
MSRIT INFORMATION SCIENCE 18
Type of linear block code which only detects errors.
Its computation resembles a long division operation in which the quotient is discarded and the remainder becomes the result.
CYCLIC REDUNDANCY CHECK(CRC)
MSRIT INFORMATION SCIENCE 19
CRC ENCODER AND DECODER
MSRIT INFORMATION SCIENCE 20
Encoder on sender’s side generates codeword.
Dataword size is k bits.
Desired codeword is n bits.
Augment dataword by appending n-k 0’s.
Divisor (predefined) of size n-k+1, divides augmented dataword in generator.
Obtained remainder is appended to dataword.
MSRIT INFORMATION SCIENCE 21
The generated codeword is sent to receiver via some transmission medium.
Decoder on receiver’s side checks for errors.
The checker divides the codeword by the same divisor.
This generates a remainder which is called a syndrome.
If the syndrome is 0 then there is no error or the error is undetected.
If syndrome is non zero, error has been detected and data is discarded.
MSRIT INFORMATION SCIENCE 22
Cyclic codes can be represented using polynomials.
Special polynomials in which co-efficient can be either 0 or 1.
The bit position of dataword indicates power of the polynomial.
Ex:- 1 0 0 1 1 0 1 1
x7 x6 x5 x4 x3 x2 x1 x0
equivalent polynomial expression x7+x4+x3+x+1.
POLYNOMIAL REPRESENTATION
MSRIT INFORMATION SCIENCE 23
The given dataword can be represented in polynomial terms.
Multiply the dataword with xn-kto generate augmented dataword.
The augmented dataword is divided by the generator polynomial g(x) and the resulting remainder is added to the augmented dataword.
Note in division when we subtract we actually perform XOR operation.
CODEWORD GENERATION
MSRIT INFORMATION SCIENCE 24
The divisor on the receiving side divides the received code word and generates a remainder.
Remainder is also called as a syndrome. If the syndrome generated is 0 then there is
no error in transmission or undetected error. Non zero syndrome means that error has
been detected. No error correction is possible using CRC.
ERROR DETECTION
MSRIT INFORMATION SCIENCE 25
Received codeword can be represented asReceived codeword=c(x)+e(x) where c(x) is original codeword e(x) is the error.
The error is detected if received codeword=c(x)+e(x) is not divisible.
g(x) If e(x) is divisible by g(x) then error goes
undetected. Single bit error:
e(x)=xi.
xi should not be divisible by g(x).x0 term should be 1 so that we can catch
the error.
MSRIT INFORMATION SCIENCE 26
Two Isolated bit errors: e(x)=xi+xj.
e(x)=xi(1+xj-i) where i<j. let j-i=t
so, e(x)=xi(1+xt) To catch xi the generator should have x0=1. To catch error of 1+xt the generator
polynomial should not divide 1+xt for 0<t<n-1.
Odd number of errorsGenerator polynomial should be a factor of
x+1.
MSRIT INFORMATION SCIENCE 27
Polynomial should contain more than one term.
Polynomial should have the x0 term equal to 1.
Polynomial should contain x+1 as a factor. Polynomial should not divide 1+xt for
0<t<n-1.
PROPERTIES OF GOOD GENERATOR POLYNOMIAL
MSRIT INFORMATION SCIENCE 28
ACKNOWLEDGEMENT
•We would like to thank Mydhili Ma’m for giving us an opportunity to present this presentation and for the support extended by her.
•We would also like to thank Mr. Mohan Kumar our project incharge.
MSRIT INFORMATION SCIENCE 29
QUESTIONS
???