100 likes | 170 Views
Learn techniques to add redundancy for error recovery in scenarios like space-based communication. Understand Hamming Distance and decoding methods to correct bit errors efficiently. Explore theoretical limits and strategies for single bit error correction.
E N D
Error Correction • Consider a scenario where retranmissions are not practical and error rate is high • Example: Space-based communication • We would like to add redundancy such that data is useful despite errors • Not only to detect but also to recover from • Similar to noisy telephone conversation on a known topic ECE 766 Computer Interfacing and Protocols
Error Correction • Assume there are only 1-bit errors and we want to recover from errors • Solution: Declare some of the bit combinations invalid • Example: 2-bit messages protected from 1-bit errors00 00000000 000000 0000 01 00001111 000111 001110 11110000 111000 110011 11111111 111111 1111 • So, how much redundancy is needed to correct d errors? ECE 766 Computer Interfacing and Protocols
Hamming Distance • Hamming Distance:The number of bit positions two codewords differ • XOR two codewords, count 1s in the result • 111010 011011 = 100001 Hamming distance = 2 • Minimum Distance:Given a set of codewords, take the minimum of Hamming distances of all valid codeword pairs • To detect d-bit errors, minimum distance of d+1 is needed • To correct d-bit errors, minimum distance of 2d+1 is needed ECE 766 Computer Interfacing and Protocols
Hamming Distance • How to decode received codewords • If codeword is valid, accept as it is • If codeword is invalid, map it to the closest valid codeword Only darker points are valid codewords Lighter ones are invalid ECE 766 Computer Interfacing and Protocols
Can We Correct Single Bit Error? • Try Obvious Brute Force Method—Send 3 copies of every bit! • Suppose data is 01110 • Send 0 0 01 1 1 1 1 1 1 1 10 0 0 • Can we correct burst errors? Yes, with trick • Send 01110 01110 01110 • Can’t we do better than that? ECE 766 Computer Interfacing and Protocols
Theoretical Limits • What is the minimum number of check bits (r) needed to correct a single bit error? • m message bits 2m legal messages • r check bits • n = m+r codeword length • Around a valid codeword, we have n invalid codewords (obtained by inverting each bit individually) • Each bit pattern requires n+1 dedicated codewords • (n+1)2m≤ 2n (m+r+1)≤ 2r ECE 766 Computer Interfacing and Protocols
11 10 9 8 7 6 5 4 3 2 1 d d d r d d d r d r r 10 = 23 + 21 = 8 + 2 r1 = d3 d5 d7 d9 d11 r2 = d3 d6 d7 d10 d11 r4 = d5 d6 d7 r8 = d9 d10 d11 7 = 22 + 21 + 20 = 4 + 2 + 1 Hamming Codes • Code Generation ECE 766 Computer Interfacing and Protocols
Hamming Codes • Decoding 11 10 9 8 7 6 5 4 3 2 1 11 10 9 8 7 6 5 4 3 2 1 1 0 0 1 1 1 0 0 1 0 1 1 0 0 1 0 1 0 0 1 0 1 Error LSB e1 = r1 d3 d5 d7 d9 d11 = 1 1 0 0 0 1 = 1 e2 = r2 d3 d6 d7 d10 d11 = 0 1 1 0 0 1 = 1 e4 = r4 d5 d6 d7 = 0 0 1 0 = 1 e8 = r8 d9 d10 d11 = 1 0 0 1 = 0 7 MSB Position of the error ECE 766 Computer Interfacing and Protocols
Hamming Codes • Hamming codes solve single error correction problem • Can we correct burst errors using Hamming codes? • Yes, with a trick! ECE 766 Computer Interfacing and Protocols