1 / 8

EEL 3705 / 3705L Digital Logic Design

EEL 3705 / 3705L Digital Logic Design. Fall 2006 Instructor: Dr. Michael Frank Lecture Module #27: Error Control Codes. Parity Codes. Used for error detection. After n bits, b 0 … b n −1 , add one more bit b n defined to be the XOR (or NXOR) of the others:

amaritza
Télécharger la présentation

EEL 3705 / 3705L Digital Logic Design

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. EEL 3705 / 3705LDigital Logic Design Fall 2006Instructor: Dr. Michael Frank Lecture Module #27:Error Control Codes M. Frank, EEL3705 Digital Logic, Fall 2006

  2. Parity Codes • Used for error detection. • After n bits, b0…bn−1, add one more bit bn defined to be the XOR (or NXOR) of the others: • With XOR, bn = b0b1…bn−2bn−1. • Using NXOR, bn = ~(b0b1…bn−2bn−1). • The extra bit bn is called a parity bit. • If XOR is used, we say the code is even parity, • because b0+b1+…+bn ≡ 0 (mod 2); the sum of all bits is an even number. • if NXOR is used, the code is called odd parity. • because b0+b1+…+bn ≡ 1 (mod 2); the sum of all bits is an odd number. • When all n bits are received, if bn does not match the remaining bits according to how it was generated, • then we know that at least one of the bits was altered in transmission. • Any single bit error can be detected using this technique. • More sophisticated variants can also be used to locate and correct bit errors. M. Frank, EEL3705 Digital Logic, Fall 2006

  3. Distance Metrics • A common distance metric between two binary words I,J of the same length n is the number of bits that differ between them. • This gives the number of single-bit errors that would have to occur to transform I into J. • The more distant the codewords in a code are from each other, the more resilient the code is to independent errors. M. Frank, EEL3705 Digital Logic, Fall 2006

  4. Distance Example • The distance between any two given 3-bit strings is the same as the number of edges of the 3-cube at right that must be traversed to get from one to the other. • E.g., d(001,110) = 3. 011 111 001 101 010 110 000 100 M. Frank, EEL3705 Digital Logic, Fall 2006

  5. General Requirements for Error Correction and Detection • Let dminbe the minimum distance between the codewords in a code C. • Then the code C can correct any set of up to t bit errors and at least detect up to s additional errors, for any pair (s,t) where 2t + s <dmin . M. Frank, EEL3705 Digital Logic, Fall 2006

  6. Example of Distance Metric and Error Correction/Detection • Consider a 3-bit code with only two codewords w1 and w2 such that d(w1,w2) = 3. (Thus, dmin = 3.) • For example, we could let w1 = 000 and w2 = 111. • With this code, we can correct any 1 error, or detect up to any 2 errors. two errors codescorrectableto w2 codescorrectableto w1 011 100 010 101 001 110 oneerror Valid codewords: 111 000 M. Frank, EEL3705 Digital Logic, Fall 2006

  7. Gray Codes • A binary Gray code for numbers (mod n) has the property that the codes for adjacent numbers differ only in 1 bit position. • d(a, a+1 mod n) = 1. • This property can help improve reliability of communication systems… • Since if a continuous signal coding a word drifts by 1 unit, it changes only 1 bit of the coded value • A 1-bit error can be detected and corrected relatively easily. • It’s also useful if there is a need to ensure that a state “in between” two subsequent codewords is not mistaken for a different codeword. • Disk spindle example • For n=2k, a k-bit Gray code can be generating using the rule that the bits of the gray code word g representing the binary number b are gi = bibi+1 • E.g., For k=2, the map b→g is 0 → 00, 1 → 01, 2 → 11, 3 → 10 • For k=3 the sequence of g’s is: 000, 001, 011, 010, 110, 111, 101, 100 • Later, we will also find that this code is useful in drawing Karnaugh maps for the optimization of digital circuits. M. Frank, EEL3705 Digital Logic, Fall 2006

  8. The Hamming Code: An Error Correction Code based on Parity Bits • Adding n+1 parity bits to a (2n−1)-bit data sequence lets us detect and correct any single error in the data or parity bits. • This is known as a Hamming code, and it is called a “perfect” code • For n=4, the space blowup caused by the parity bits is 33.33% • Overhead gets smaller as n increases. (e.g. n=10  1.07% overhead) • p is the XOR of all data bits • pi includes dj if bit i is 1 inthe binary expansion of j • If dj is altered, p indicates anerror has occurred, and the pitogether give the value of j. • If pi is altered, then p indicatesthis, and pi can be regenerated • If p is altered, the pi show this and p can be regenerated. Codeword for n=4: (d1,…,d15, p, p0, p1, p2, p3) Where p = d1d2…d14d15,p0 = d1d3d5d7d9d11d13d15,p1 = d2d3d6d7d10d11d14d15,p2 = d4d5d6d7d12d13d14d15, p3 = d8d9d10d11d12d13d14d15. M. Frank, EEL3705 Digital Logic, Fall 2006

More Related