Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Architecture Error Correcting Codes Ralph Grishman Oct. 2015 (Text pp. 420-421 and B-65-67) NYU.

Similar presentations


Presentation on theme: "Computer Architecture Error Correcting Codes Ralph Grishman Oct. 2015 (Text pp. 420-421 and B-65-67) NYU."— Presentation transcript:

1 Computer Architecture Error Correcting Codes Ralph Grishman Oct. 2015 (Text pp. 420-421 and B-65-67) NYU

2 Codes A code = a set of valid bit patterns If all bit patterns are valid, no error can be detected If only some are valid, any error which changes a valid pattern into an invalid one will be detectable 10/13/15Computer Architecture lecture 112

3 Hamming Distance Hamming distance between two bit patterns = number of bit positions where they differ Hamming distance for a code = minimum distance among all pairs A code with distance d can detect d-1 or fewer errors Ex: parity bit  distance 2  can detect all single errors 10/13/15Computer Architecture lecture 113

4 Correcting multiple errors By inceasing the distance of a code, we can detect multiple errors or correct errors: – Distance 2: single error detection – Distance 3: single error correction – Distance 4: single error correction & double error detection 10/13/15Computer Architecture lecture 114

5 Single error correction code Each code symbol has n bits m bits are associated with info to be transmitted k=n-m bits are used for error detection & correction 10/13/15Computer Architecture lecture 115

6 Checking When a code symbol is received, we will apply k parity checks – If parity is odd, write 1, else write 0 – This produces a k-bit checking number – Want Checking number = 0  no errør Checking number = i  error in bit i 10/13/15Computer Architecture lecture 116

7 Creating a code symbol (number bits 1,…,n) Bit positions 2 0, 2 1, …, 2 k-1 are used as checking positions The i th check is even parity over all bits in bit positions whose 2 i-1 place bit = 1 Ex: n=7 m=4 k=3 Check #1: check position=1 checks positions 1, 3, 5, 7 Check #2: check position=2 checks positions 2, 3, 6, 7 Check #3: check position=4 checks positions 4, 5, 6, 7 Positions 3, 5, 6, 7 are information positions 10/13/15Computer Architecture lecture 117

8 Example: Encoding Encoding the number 5: 10/13/15Computer Architecture lecture 118 1234567 0101 00101 010101 0100101 Check #1: check position=1 checks positions 1, 3, 5, 7 Check #2: check position=2 checks positions 2, 3, 6, 7 Check #3: check position=4 checks positions 4, 5, 6, 7 Positions 3, 5, 6, 7 are information positions

9 Checking Error in bit __1___ Apply checks: Check #1 checks positions 1, 3, 5, 7 Check #2 checks positions 2, 3, 6, 7 Check #3 checks positions 4, 5, 6, 7 – Bit position _001____ in error 10/13/15Computer Architecture lecture 119 1 0 0


Download ppt "Computer Architecture Error Correcting Codes Ralph Grishman Oct. 2015 (Text pp. 420-421 and B-65-67) NYU."

Similar presentations


Ads by Google