Lecture 10
Lecture 10
• A frame consists of m data (i.e., message) bits and r redundant (i.e. check) bits.
• In a block code
• the r check bits are computed solely as a function of the m data bits with which they are associated
• In a systematic code
• the m data bits are sent directly, along with the check bits, rather than being encoded themselves
before they are sent.
• In a linear code
• the r check bits are computed as a linear function of the m data bits.
• Let the total length of a block (codeword) be n (i.e., n = m + r).
• This is referred to as an (n,m) code.
• An n-bit unit containing data and check bits is referred to as an n bit codeword
• The code rate, or simply rate
• is the fraction of the codeword that carries information that is not redundant, or m/n
• They might be 1/2 for a noisy channel, in which case half of the received information is redundant
• or close to 1 for a high-quality channel, with only a small number of check bits added to a large
message.
Error Correction: Hamming codes
• Given any two codewords that may be transmitted or received—say, 10001001 and 10110001
• it is possible to determine how many corresponding bits differ.
• To determine how many bits differ
• just XOR the two codewords and count the number of 1 bits in the result
• Hamming distance: 10001001 <convert from one to the other using 3 sing bit changes> 10110001
• The number of bit positions in which two codewords differ is called the Hamming distance
• Significance:
• if two codewords are a Hamming distance d apart, it will require d single-bit errors to convert one into
the other.
• In most data transmission applications, all 2m possible data messages are legal
• but due to the way the check bits are computed, not all of the 2n possible codewords are used.
• when there are r check bits, only the small fraction of 2m /2n or 1/2r of the possible messages will be legal
codewords.
• It is the sparseness with which the message is embedded in the space of codewords that allows the receiver
to detect and correct errors -> very unlikely that multiple errors in a codeword will change the codeword
into another valid codeword
Example
n=4 To correct single bit error
0000
0001
0010
m=3
0011
000 0100 Example codewords (with distance = 2):
001 0101 0000, 0101, 0110 …
010 0110
011 0111 0000 -> (1 bit error) -> 0100 -> (1 bit error) -> 0101
100 1000
101 1001 Example codewords (with distance = 3):
110 1010 0000, 0111, …
111 1011
1100 0000 -> (1 bit error) -> 0100 -> (1 bit error) -> 0101 -> (1 bit error) -> 0111
1101
1110
1111
• the bit position that includes 1 in the first position • the bit positions that includes 1 in the second position are
are 1, 3, 5, 7. 2, 3, 6, 7.
• We perform the even-parity check at these bit • we perform the even-parity check at these.
positions. • The total number of 1 at these bit positions
• The total number of 1 at these bit positions corresponding to r2 is odd, therefore, the value
corresponding to r1 is even, therefore, the of the r2 bit is 1.
value of the r1 bit is 0.
Error Correction: Hamming codes
• Determining the Parity bits
• Data transferred
• Determining the r4 bit:
• The r4 bit is calculated by performing a parity check
on the bit positions whose binary representation
includes 1 in the third position.
Recalculation of Parity bits at the receiving end and compare with the received parity bits