Lecture 4 Error Detection Forward Error Correction Hamming

  • Slides: 12
Download presentation
Lecture 4 - Error Detection - Forward Error Correction (Hamming Code) - 1

Lecture 4 - Error Detection - Forward Error Correction (Hamming Code) - 1

1 - Error Detection 1. 1 Parity check 1. 2 Two dimensional parity check

1 - Error Detection 1. 1 Parity check 1. 2 Two dimensional parity check 1. 3 Checksum 1. 4 Cyclic redundancy check 2

1. 1 Parity check - Appends a parity bit to the end of the

1. 1 Parity check - Appends a parity bit to the end of the data. 10110010 0 Even 10110010 1 Odd - It can detect all single bit errors. -It can also detect burst errors, if the number of bits in error is odd. 3

1. 2 Two Dimensional Parity Check -Parity check bits are calculated for each -

1. 2 Two Dimensional Parity Check -Parity check bits are calculated for each - equivalent to a simple parity check bit. -Parity -Both row, which is check bits are also calculated for all columns. are sent along with the data. 4

1. 2 Two Dimensional Parity Check 5

1. 2 Two Dimensional Parity Check 5

1. 3 Checksum - At the sender’s end, the data is divided into segments.

1. 3 Checksum - At the sender’s end, the data is divided into segments. -The segments are added using ones complement arithmetic to get the sum. -The sum is complemented to get the checksum which is sent along with the data segments. -At the receiver, the received segments are added using ones complement arithmetic to get the sum. -If the complement of the sum is zero, the received data is accepted. 6

1. 3 Checksum Ex: Find the checksum at the sender and receiver for the

1. 3 Checksum Ex: Find the checksum at the sender and receiver for the following sequence: 10110011 10101011010 11010101 10110011 10101011 _____ 01011110 1 ________ 01011111 01011010 ________ 10111001 11010101 _______ 10001110 1 _______ sum: 10001111 Checksum: 01110000 10110011 10101011 _____ 01011110 1 ________ 01011111 01011010 ________ 10111001 11010101 _______ 10001110 1 _______ 10001111 01110000 ________ Sum: 1111 Checksum: 0000 7

1. 4 Cyclic Redundancy Check -The sender generates a bit sequence known as a

1. 4 Cyclic Redundancy Check -The sender generates a bit sequence known as a frame check sequence (FCS), so that the resulting frame consisting of the original data followed by this FCS. - FCS is the remainder which obtained from dividing the original data M(X) by generator polynomial G(x). - The receiver divides the incoming frame by G(X), if there is no remainder the received data has no errors. 8

1 1. 4 Cyclic Redundancy Check 1001 1010000 1011 ____ 0010 0000 _____ 0100

1 1. 4 Cyclic Redundancy Check 1001 1010000 1011 ____ 0010 0000 _____ 0100 0000 _____ 1000 1011 _____ FCS 0 1 1 1010011 1011 ____ 0010 0000 _____ 0101 0000 _____ 1011 _____ 000 9

1. 4 Cyclic Redundancy Check C 3 C 1 C 0 + Initial 1

1. 4 Cyclic Redundancy Check C 3 C 1 C 0 + Initial 1 000 001 010 1010000 + 0 001 0 010 100 011 FCS 10

2 - Forward Error Correction -Forward Error correction (FEC) which based on the receiver

2 - Forward Error Correction -Forward Error correction (FEC) which based on the receiver only is used mainly when retransmissions cannot be requested, e. g. , simplex links. -Backward error correction which based on retransmission of the frame when an error is detected is commonly used. Hamming Code: • It can correct any single bit error • Bits in power of 2 positions (1, 2, 4, 8, ) are check bits, the rest are m data bits • Check bit forces the parity of some collection of bit “ 1” to be even • To see which check bits the data bit in position k contributes to, rewrite k as a sum of powers of 2. 11=1+2+8, 29=1+4+8+16 11

Hamming Code EX: If a 12 -bit hamming code 100110111000 arrives at receiver, is

Hamming Code EX: If a 12 -bit hamming code 100110111000 arrives at receiver, is there any bit error? If so, which bit is wrong? 1 2 3=2+1 4 5=4+1 6=4+2 7=4+2+1 8 9=8+1 10=8+2 11=8+2+1 12=8+4 10 0 11 0 1 11 0 0 0 Checked Data bits bit Bits Sequence 1 3 5 7 9 11 101110 2 3 6 7 10 11 0 0 0 1 0 0 (No) 4 5 6 7 12 11010 8 9 10 11 12 11000 (Yes) (No) (Yes) Hence bit 6 = 2+4 is wrong, so correct hamming code should be 100111111000 12