1 / 65

Unit IV Part I

Unit IV Part I. Prepared by :Mr. Badgujar D D SIT, Lonavala. Error Detection and Correction. Whenever bits flow from one point to another , they are subject to unpredictable changes from interferences. This interference can change the shape of the signal. Single-bit error.

javen
Télécharger la présentation

Unit IV Part I

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Unit IV Part I Prepared by :Mr. Badgujar D D SIT, Lonavala

  2. Error Detectionand Correction • Whenever bits flow from one point to another , they are subject to unpredictable changes from interferences. This interference can change the shape of the signal.

  3. Single-bit error • Only 1 bit of a given data unit is changed from 1 to 0 / from 0 to 1. • These error are the least likely type of error in serial data transmission . Consider data sent at 1Mbps . This means that each bit lasts only 1/1,000,000 sec = 1micro sec. • For single bit error the noise must have a duration of only 1 microsec which is very rare. Noise lasts much longer than this.

  4. Burst error Length of Burst • It is not necessary the burst error is consecutive bits. The length of the burst is measured from the first corrupted bit to the last corrupted bit. Some bits in between may not have been corrupted. • The burst error is more likely to occur than a single bit error . The duration of noise is normally longer than the duration of 1 bit, which means that when noise affects data , it affects a set of bits. The no. of bits affected depends on the data rate and duration of noise. • If we are sending data at 1kbps , a noise of 1/100 s can affect 10 bits; if data rate 1Mbps then 10000 bits affected

  5. Redundancy: The central concept in detecting or correcting errors is redundancy. To be able to detect or correct errors sender will add some extra bits with our data . These redundant bits are added by the sender and removed by receiver . Their presence allows the receiver to detect or correct corrupted bits. • Detection Vs Correction: The correction is more difficult than the detection. • In error detection we are looking only to see if any error has occurred. The answer is simply yes/no. we are not interested in the no. of errors.

  6. Error correction : We are interested exact no. of bits are corrupted and exact location of these bits in message. If we need to correct the 1 bit error in 8-bit data ,we need to consider 8 possible error locations. It is simple but as data is large it is quite difficult. • There are 2 methods of error corrections 1. Forward error correction is the process in which receiver tries to guess the message by using redundant bits. 2. Correction by retransmission : when receiver detects the occurrence of error and asks the sender to retransmit the message. This is repeated until message received without errors.

  7. Coding: 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 relationship between the two sets of bits to detect or correct the errors. Sender Receiver Encoder Message Message Decoder Checker Generator Unreliable Transmission Received Information Message and Redundancy

  8. Modular Arithmetic : In modulo-N arithmetic ,we use only the integers in the range 0 to N-1 , both inclusive.

  9. Block Coding • Datawords: 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 a length n=k+r. The resulting n-bit blocks are called codewords. • It is important to know that we have a set of datawords each of size k and a set of codewords of size n. • With k bits , we can create a combination of 2^k datawords; with n bits ,we can create a combination of 2^n codewords

  10. Since n>k, the no. of possible codewords are larger than of possible datawords. • The block coding process is one-to-one ; the same dataword is always encoded as the same codeword. • This means that we have 2^n- 2^k codewords are not used we called them invalid or illegal • E.g. k=4 and n=5 then 2^k=16 dataword and 2^n= 32 codeword. 16 codewords are used for message transfer and 16 are not used because it is one-to-one

  11. Error Detection in Block Coding • If the following 2 conditions meet  The receiver has a list of valid codewords.  The original codeword has changed to an invalid one

  12. Sender Receiver Process of Error Detection Encoder Message Dataword Decoder Extract Checker Generator • Each codeword sent to the receiver may change during transmission . If the received codeword is same as one of the valid codeword, the word is accepted , the corresponding dataword is extracted for use. If the received codeword is not valid , it is discarded Discard Unreliable Transmission Codeword Codeword

  13. If the codeword is corrupted during transmission but the received word is still matches a valid codeword , the error remains undetected. • This type of coding can detect only single errors. Two or more errors remains undetected. • E.g. k=2 and n=3 The codeword and dataword are Dataword Codeword 00 000 01 011 10 101 11 110

  14. From e.g. Assumes that sender encodes the dataword 01 as 011 and sends to the receiver consider the following cases : The receiver receives 011. It is valid codeword . The receiver extracts the dataword 01 from it. • The codeword is corrupted during transmission and 111 is received which is not valid codeword so it is discarded. • The codeword is corrupted during transmission and 000 is received (right most bits are corrupted to 00).This is valid codeword. The receiver incorrectly extracts the dataword 00. Two corrupted bits have made the error undetectable.

  15. Error Correction • In this the receiver needs to find the original codeword sent. • Fig. shows error correction the checker function is quite complex as compare to Error Detection. Sender Receiver Encoder Message Dataword Decoder Extract Checker Generator Discard Unreliable Transmission Codeword Codeword

  16. Consider dataword and codeword for previous e.g. with adding 2 more bits to codeword. Dataword Codeword 00 00000 01 01011 10 10101 11 11110 Assume the dataword 01. the sender consults the table and codeword for this is 01011. the codeword is corrupted during transmission and 01001 is received( error in 2nd bit from right side).

  17. First, the receiver finds that the codeword is not in the table . This means error is occurred . The receiver assumes that there is only 1 bit corrupted , uses the following strategy to guess the correct dataword Comparing the received codeword with the first codeword in the table (01001 vs 00000) the receiver decides that the first codeword is not the one that was sent because there are 2 different bits.  Due to same reason the original codeword cannot be 3rd and 4th in the table.

  18.  The original codeword must be 2nd 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 dataword 01

  19. Hamming Distance • The hamming distance is the difference between two words i.e. corresponding bits. We show it by the x and y d(x,y) • The Hamming distance can easily be found if we apply the XOR operation on the two words and count the number of 1s in the result. • Hamming distance is a value greater than zero. • E.g. The Hamming distance d(000,011)=2 0 0 0 XOR 0 1 1= 0 1 1 The no. of 1=2 Hence d=2

  20. Minimum Hamming Distance : It is the smallest Hamming distance between all possible pairs in a set of words. Which is denoted by dmin • E.g. d(00000,01011)=3 d(00000,10101)=3 d(00000,11110)=4 d(01011,10101)=4 dmin=3

  21. Three parameters : The coding scheme needs at least 3 parameters the codeword n, the dataword=k and minimum Hamming Distance= dmin • A coding scheme C is written as C(n,k) with a separate expression for dmin

  22. Hamming Distance and Error • When a codeword is corrupted during transmission , the Hamming distance between the sent and received codeword is the no. of bits affected by the error . • E.g. Codeword=00000 is send and received 01101 is received , 3 bits are in error and the Hamming distance between the two is d(00000,01101)=3

  23. Minimum Distance for Error Detection • Suppose we want to detect s errors . If s occurs during transmission , the Hamming Distance between the sent codeword and received codeword is s. • i.e. 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

  24. Minimum Distance for Error Correction • When a received codeword is not a valid codeword , the receiver needs to decide which valid codeword was actually sent . The decision is based on concept of territory, an exclusive are surrounding the codeword. Each valid codeword has its own territory. • We use geometric approach to define each territory with a radius of t and the valid codeword is at the centre.

  25. E.g. Suppose a codeword x is corrupted by t bits or less. Then this corrupted codeword is located either inside or on the perimeter of this circle. If the receiver receives a codeword that belongs to this territory, it decides that the original codeword is the one at the centre. Note assume that only up to t errors has occurred; otherwise , the decision is wrong. • To guarantee correction of up to t errors in all cases, the minimum Hamming distance in a block code must be dmin=2t+1

  26. E.g. Hamming distance dmin=4 What is the error detection and correction capability of this scheme? This code guarantees the detection of up to three error (s=3), but it can correct up to one error. If this code is used for error correction, part of its capability is wasted. Error correction codes need to have an odd minimum distance (3,4,7…)

  27. Linear Block Code • All block codes used today belongs to a subset called linear block codes. • The structure of nonlinear block codes is difficult due to their structure. • The exclusive-OR (XOR) of any two valid codeword creates another valid codeword.

  28. e.g. Dataword Codeword 00 000 01 011 10 101 11 110 XOR of any two codeword creates a valid codeword.

  29. E.g. Dataword Codeword 00 00000 01 01011 10 10101 11 11110

  30. Minimum distance for Linear Block Code • It is the number of 1s in the nonzero valid codeword with the smallest no. of 1s e.g. Dataword Codeword 00 000 01 011 10 101 11 110 The no. of 1s in nonzero codeword are 2,2,2 so minimum hamming distance is dmin=2

  31. Some Linear Block Code • Simple Parity- Check Code:-In this scheme the k bits dataword is changed to n bits codeword where n=k+1. The extra bit is called as parity bit , is selected to make the total number of 1s in the codeword even. • Minimum Hamming distance for this category dmin=2, which means that the code is used for single bit error ;it cannot correct any error

  32. Dataword Dataword a3 a2 a1 a0 a3 a2 a1 a0 Accept Discard Syndrome Decision Logic S0 Generator • If the no. of 1s are even then 0 is added , If no. of 1s are odd 1 is added. • The receiver receives 5 bit word. The checker does the same thing as the generator in the sender with one exception; The addition is done all 5 bits. The result which is called syndrome which is 1 bit • The syndrome is 0 when no. of 1s are even otherwise 1 Checker Parity Bit a3 a2 a1 a0 r0 Codeword b3 b2 b1 b0 q0 Codeword

  33. The syndrome is passed to the decision logic analyzer. If the syndrome is 0, there is no error in the received codeword; the data portion of the received codeword is accepted as the dataword . If the syndrome is 1, the data portion of the received codeword is discarded. The dataword is not created.

  34. Assume that sender sends dataword 1011 The codeword created from it 10111 which is send to the receiver. Consider following cases : • No error occurred, the received codeword is 10111 The syndrome is 0 the dataword 1011 is created. • Single bit a1 changes from 1 to 0 i.e. 10011. The syndrome is 1. No dataword is created • One single bit r0 changes The received codeword is 10110. The syndrome is 1, No dataword is created because the code is not sophisticated enough to show the position of the corrupted bit.

  35. r0 changes and a3 changes . The received codeword 00110. The syndrome is 0. the dataword 0011 is created at the receiver. The dataword is wrongly created due to the syndrome value. The simple parity does not check even no. of errors. • a3, a2,a1 changes now the codeword @ receiver is 01011. The syndrome is 1 hence no dataword is created. The simple parity check allows to detect single bit error and odd no. of errors.

  36. Hamming Codes • These codes are originally designed with dmin=3 , which means that they can detect up to two errors or correct 1 single error • We need is to choose an integer m>=3. The values of n & k are then calculated from m as n=2^m -1 and k=n-m. The no. of check bits r=m

  37. a3 a2 a1 a0 a3 a2 a1 a0 Structure of Hamming Codes Encoder and Decoder Accept Discard S2 S1 S0 Correction Logic Generator Checker a3 a2 a1 a0 r2 r1 r0 a3 a2 a1 a0 q2 q1 q0

  38. A copy of a 4-bit dataword is fed into the generator that creates 3 parity checks r0,r1,r2 as shown below: r0=a2+a1+a0 modulo-2 r1=a3+a2+a1 modulo-2 r2=a3+a1+a0 modulo-2 The combination may be anything. Each of the parity-check bits handles 3 out of the 4 bits of the dataword. The total number of 1s in each 4-bit combination (3 dataword and 1 parity )must be even

  39. The checker in the decoder creates 3 bit syndrome as follows • S0=b2+b1+b0+q0 modulo 2 • S1=b3+b2+b1+q1 modulo 2 • S2=b1+b0+b3+q2 modulo 2 • The three bit syndrome create 8 possibilities from 000 to 111 as shown in the table

  40. Syndrome 000 001 010 011 100 101 110 111 Error None q0 q1 b2 q2 b0 b3 b1 • The generator is not concern with the colored cases because there is no error or an error in the parity bit. • If q0 is in error ,s0 is the only bit affected; the syndrome ,therefore is 001. • If b2 is in error , S0 and s1 are affected, the syndrome is therefore 011 etc.

  41. E.g. • The dataword 0100 becomes the codeword 0100011. The codeword 0100011 is received. The syndrome is 000(no error) the final dataword is 0100 • Dataword=0111 becomes codeword= 0111001. Received codeword=0011001 . The syndrome is 011. According to table b2 is in error. After flipping b2 ( 1 to 0) the final dataword 0111 is detected.

  42. The dataword=1101 codeword=1101000. The codeword 0011001 is received (two errors). The syndrome is 101 which means b0 is in error. After flipping b0 we get 0000, the dataword. This shows that our code cannot correct two errors.

  43. Cyclic Codes • Are the special linear codes with one extra property. If the code is cyclically shifted, the result is another codeword. E.g. If the codeword=1011000 and we shift it to 0110001

  44. a3 a2 a1 a0 a3 a2 a1 a0 Cyclic Redundancy Check Accept S2 S1 S0 Correction Logic Discard Generator Checker a3 a2 a1 a0 r2 r1 r0 a3 a2 a1 a0 q2 q1 q0 d3 d2 d1 d0 Divisor

  45. Cyclic Redundancy Check • In encoder , the dataword has k bits; the codeword has n bits. The size of dataword is augmented by n-k 0s to the right side of the word. The n bit are fed to generator. The generator uses a divisor of size n-k+1, predefined and agreed upon. The generator divides the augmented dataword by the divisor( modulo 2 division). The quotient of the division is discarded , the remainder is appended to the dataword to create the codeword.

  46. Decoder receives possibly corrupted codeword .A copy of all n bits is fed to the checker which is a replica of the generator. The remainder produced by the checker is a syndrome of n-k bits, which is fed to the decision logic analyzer . The analyzer has simple function. If the syndrome bits are all 0s, the leftmost 4 bits are accepted as the dataword ; otherwise the bits are discarded.

  47. E.g. Dataword= 1001 Divisor=1011 1010 1011)1001000 Codeword=1001110 1011 00100 000 1000 1011 00110 0000 110

  48. At the receiver side the codeword is divided by 1011 if the remainder is 0 then data is accepted otherwise it is rejected. • Consider the codeword is changed to 1000110 See the sequence at decoder(Receiver)

  49. Polynomials • A pattern of 0s and 1s can be represented as a polynomial with coefficient of 0 and 1. The power of each term shows the position of the bit; the coefficient shows the value of the bit. Fig. shows. • i.e. x^6+x+1 1 0 0 0 0 1 1 1x^6+0x^5…………..+1x^1+1x^0 • A 7-bit pattern can be replaced by three terms.

More Related