Error Detection and Correction Fixing 0101X011
Computer Errors RAM isn't perfect
Computer Errors Networks aren't either
Computer Errors How the heck do you read 1s and 0's off this?
A message 4 bit message: 1010
A message 4 bit message: An errror:
Trick 1 : Repetition To avoid misunderstanding, repeat yourself… Copy 1 Copy 2 Copy 3
Trick 1 : Repetition An error: Copy 1 Copy 2 Copy 3
Trick 1 : Repetition Most common message wins: Copy 1 Copy 2 Copy 3
Trick 1 : Repetition What if every message is wrong: Copy 1 Copy 2 Copy 3
Trick 1 : Repetition Most common bit wins: Copy 1 Copy 2 Copy Corrected
Trick 1 : Repetition More errors: Copy 1 Copy 2 Copy "Corrected"
Trick 1 : Repetition Best 3 out of 5? Copy 1 Copy 2 Copy 3 Copy 4 Copy Corrected
Overhead Message size : 4 bits Including repetition : 12 bits
Overhead Message size : 4 bits Including repetition : 12 bits 200% overhead 10Mb download is now 30Mb!
Trick 2 : Redundancy Redundancy : more information than strictly required Common linguistic trick: He took his seat She took her seat They took their seats
Trick 2 : Redundancy Redundancy : more information than strictly required Common linguistic trick: He took his seat She took her seat They took their seats
Trick 2 : Redundancy Repetion is redundancy – Can we be redundant more efficently?
Hamming Distance Hamming Distance : number of different bits , 1110, 1000, , 0000, 0011, 1100, 1111, , 0001, 0111, Distance
Normal Binary 4 bits : 16 possible values:
Normal Binary Distance of 1 between values… any error will look like new value 1 bit errors for
Hamming Code Add extra bits to "space out" messages 4 bit message with 3 error correction bits: MessageCoded Message 0000 0001 0010 0011
Hamming Code 7 bits could be 2 7 = 128 codes Only use 16 of them
Hamming Code Every code word has distance of 3+ from other messages:
Our Message We get: Which message was it meant to be?
Errors Assuming – Started with valid code word – Only one error Then – 1 bit from one valid word – 2+ bits from another valid code word Valid Code A Valid Code B Valid Code C Error
Our Message We get: Find the code with distance of
Errors Assuming 1 error bit, we can identify correct message: Received codesAfter decoding , , , , ,
Hamming Code Overhead Message size : 4 bits Code word: 7 bits 75% overhead… 512bit message can be encoded with 522bits: 2% overhead!
Trick 3 : Checksums Parity – Odd or even number of 1's 1 extra bit used to make odd num of 1's data checkbit
Trick 3 : Checksums Message: All 1 bit errors:
Trick 3 : Checksums Checksum for decimal number: – Add digits, mod by 10: Message: – = 28 – 28 mod (clock size) 10 = 8 Coded message:
Trick 3 : Checksums Coded message: Error message: Check: – = 22 – 22 mod (clock size) 10 = 2!!! we have a problem
Two Errors Coded message: Error message: Check: – = 18 – 18 mod (clock size) 10 = 8!!! we missed it
Staircse Code Multiply each digit by its place: Message: – 4 x x x x x 5 = 87 – 87 mod (clock size) 10 = 7 Coded message:
Two Errors w Stair Case Coded message: Error message: Check: – 4 x x x x x 5 = 61 – 61 mod (clock size) 10 = 1!!! we caught it
Real Life Stair Case ISBN – books:
Trick 4: Pinpoint How did I do it?
Trick 4: Pinpoint How did I do it? Every Row & Col should have odd # of black squares
Trick 4: Pinpoint How did I do it? Every Row & Col should have odd # of black squares
Trick 4: Pinpoint Message / Checksum
Trick 4 : Pinpoint With decimal values:
Trick 4 : Pinpoint With decimal values:
Trick 4 : Pinpoint With decimal values:
Trick 4 : Pinpoint With decimal values: off by 2
Hamming Code Hamming Codes as pinpoint parity checks: /SAMPLE_ html
Real Life Checksum Last digit of credit card number calculated to