6 RedundancyTo detect or correct errors, redundant bits of data must be added
7 Coding Process of adding redundancy for error detection or correction Two types:Block codesDivides the data to be sent into a set of blocksExtra information attached to each blockMemorylessConvolutional codesTreats data as a series of bits, and computes a code over a continuous seriesThe code computed for a set of bits depends on the current and previous input
8 XOR OperationMain operation for computing error detection/correction codesSimilar to modulo-2 addition
9 Block Coding Message is divided into k-bit blocks Known as datawordsr redundant bits are addedBlocks become n=k+r bitsKnown as codewords
14 Example: Error Correction Code k, r, n = ?The receiver receives 01001, what is the original dataword?
15 Hamming Distance d(01, 00) = ? d(11, 00) = ? d(010, 100) = ? Hamming Distance between two words is the number of differences between corresponding bits.d(01, 00) = ?d(11, 00) = ?d(010, 100) = ?d(0011, 1000) = ?How many 8-bit words are n bits away from ?
16 Minimum Hamming Distance The minimum Hamming distance is the smallest Hamming distance between all possible pairs in a set of words.Find the minimum Hamming Distance of the following codebook00000010111010111110
17 Detection Capability of Code To guarantee the detection of up to s-bit errors, the minimum Hamming distance in a block code must bedmin = s + 1
18 Correction Capability of Code To guarantee the correction of up to t-bit errors, the minimum Hamming distance in a block code must bedmin = 2t + 1
19 Example: Hamming Distance A code scheme has a Hamming distance dmin = 4. What is the error detection and correction capability of this scheme?
20 Common Detection Methods Parity checkCyclic Redundancy CheckChecksum
21 Parity Check Most common, least complex Single bit is added to a block Two schemes:Even parity – Maintain even number of 1sE.g., 1011 10111Odd parity – Maintain odd number of 1sE.g., 1011 10110
22 Example: Parity CheckSuppose the sender wants to send the word world. In ASCII the five characters are coded (with even parity) asThe following shows the actual bits sent
23 Example: Parity Check Receiver receives this sequence of words: Which blocks are accepted? Which are rejected?
35 Strength of CRC M(x)xn = Q(x)G(x) + R(x) Can be analyzed using polynomialM(x) – Original messageG(x) – Generator polynomial of degree nR(x) – Generated CRCTransmitted message isM(x)xn – R(x)which is divisible by G(x)M(x)xn = Q(x)G(x) + R(x)
36 Strength of CRC Received message is M(x)xn – R(x) + E(x) where E(x) represents bit errorsReceiver does not detect any error when E(x) is divisible by G(x), which means either:E(x) 0 No errorE(x) 0 Undetectable error
37 Strength of CRCIf G(x) contains at least two terms, then all single-bit errors can be detectedIf G(x) cannot divide xt + 1 (0 t < n), then all isolated double errors can be detectedIf G(x) contains a factor of (x+1), all odd-numbered errors can be detected
38 Properties of Good Polynomial It should have at least two termsThe coefficient of the term x0 should be 1It should not divide xt + 1, for t between 2 and n − 1It should have the factor x + 1
39 CRC's Strength Summary All burst errors with L ≤ n will be detected All burst errors with L = n + 1 will be detected with probability 1 – (1/2)n–1All burst errors with L > n + 1 will be detected with probability 1 – (1/2)n
40 Example: CRC Generators Which of the following polynomials guarantees that a single-bit error can be detected(a) x+1(b) x3(c) 1
41 Example: CRC Generators Criticize the following CRC generatorsx3x10 + x9 + x5x6+1
43 Error Correction Two methods Retransmission after detecting error Forward error correction (FEC)
44 Forward Error Correction Consider only a single-bit error in k bits of datak possibilities for an errorOne possibility for no error#possibilities = k + 1Add r redundant bits to distinguish these possibilities; we need2r k+1But the r bits are also transmitted along with data; hence2r k+r+1
45 Number of Redundant Bits Number of data bits kNumber of redundancy bits rTotal bitsk + r123564791011
46 Hamming Code Simple, powerful FEC Widely used in computer memory Known as ECC memoryerror-correcting bits
50 Strength of Hamming Code Minimum Hamming Distance is 3It can correct at most 1 bit errorIt can detect at most 2 bit errorBut… not both!!! (Why?)SECDED – Extended Hamming code with one extra parity bitAchieves minimum Hamming distance of 4Can distinguish between one bit and two bit errors