Beruflich Dokumente
Kultur Dokumente
• Retransmission
• Error Detection
• Error Correction
• Block Coding
• Modulo 2 arithmetic – XOR operation
Error Control – Block Coding
• Divide message into blocks,
– each of k bits, called datawords
– add r redundant bits to each block to make the
length n = k + r.
– The resulting n-bit blocks are called codewords.
– Since n > k, the number of possible codewords is
larger than the number of possible datawords.
– The block coding process is one-to-one; the same
dataword is always encoded as the same
codeword.
Block Coding(without Error)
Source Encoder
00 001
Decoder
00
Block Coding(with Error)
Source Encoder
00 001
Decoder
01 010
Error Detection
Steps
Datawords Codewords • The receiver receives 011. It is a
00 000 valid codeword. The receiver
01 011 extracts the dataword 01 from it.
10 101
11 110 • The codeword is corrupted during
transmission, and 111 is received
(the leftmost bit is corrupted).
• This is not a valid codeword and is
discarded.
• The codeword is corrupted during
transmission, and 000 is received
(the right two bits are corrupted).
This is a valid codeword. The
receiver incorrectly extracts the
dataword 00. Two corrupted bits
have made the error undetectable.
Hamming Distance(XOR)
• Find the minimum Hamming distance of the coding scheme
– d(OOO, 011) =2
Why cant apply Hamming distance?
– d(O11,110)=2 How will u decide r bits?
– dmin is 2. Why XOR instead of AND (or) OR
operation?
• d(OOO, 101) =2 d(101, 110) =2 How will u know the location of error
in Hamming code algorithm?
• d(O0O, 110) =2 d(011, 101) =2 How rearranging the data makes u to
detect burst error
• Find the minimum Hamming distance of the coding scheme
– d(OOOOO, 01011) = 3 d(01011, 10101) =4
• The dmin is 3.
– d(OOOOO, 10101) =3 d(OlO11, 11110) = 3
– d(OOOOO, 11110) = 4 d(10101, 11110) =3
• Dmin is 3
Linear Block Codes
• Simple Parity Check Code:
– k-bit dataword
– n-bit codeword where n = k + 1(codeword even)
– dmin =2
– Can detect single bit error
Simple Parity check C(5,4)
Datawords Codewords Datawords Codewords
0000 00000 1000 10001
0001 00011 1001 10010
0010 00101 1010 10100
0011 00110 1011 10111
0100 01001 1100 11000
0101 01010 1101 11011
0110 01100 1110 11101
0111 01111 1111 11110
Encoder and Decoder for single Parity Check
Syndrome Bit
• Sender Side --------------- modulo 2 arithmetic
– r0 = a0+a1+a2+a3
• Receiver Side
– s0 = b0+b1+b2+b3+r0
• If Syndrome bit is 0 – no error else error
Example - LRC
• S = 1011 G = 10111
R = 10111 S0= 0 - no error
• S = 1011 G = 10111R = 10011 S0 = 1 – Error
• S = 1011 G = 10111
R = 10110 S0 = 1 - Error
• S = 1011 G = 10111
R = 10001 S0 = 0 – No error
(data is modified)
• Two Dimensional Parity Check Code - Vertical
Redundancy Check?
https://www.geeksforgeeks.org/gate-gate-it-2008-question-64/
Encoder and Decoder for Hamming
Code
Hamming Code Error detection and correction
• Sender Source ----------------------
– r0 = a0+a1+a2 modulo 2 arithmetic
– r1 = a1+a2+a3
– r2 = a1+a3+a0
• Receiver - Destination
– s0 = b0+b1+b2 + q0 modulo 2 arithmetic
– s1 = b1+b2+b3 + q1
– s2 = b1+b3+b0 + q2
• Error detection and Correction
Error Detection and Correction
(Single Bit)
1011
Augment by
3
Divide the first term of the
dividend by the first term
of the divisor to get the
quotient.
Multiply the term in the
quotient by the divisor
and subtract the result
from the dividend 1001110
Repeat steps until the
dividend degree is less
than the divisor degree. Receiver?
Checksum
Problems
• Suppose our data is a list of five 4-bit numbers
that we want to send to a destination. In
addition to sending these numbers, we send the
sum of the numbers. For example, if the set of
numbers is (7, 11, 12, 0, 6), we send (7, 11, 12, 0,
6, 36), where 36 is the sum of the original
numbers.
• The receiver adds the five numbers and
compares the result with the sum. If the two are
the same, the receiver assumes no error, accepts
the five numbers, and discards the sum.
Otherwise, there is an error somewhere and the
data are not accepted. –
• Make rcvr side operation in single step
Problem - Checksum
• We can make the job of the receiver easier if
we send the negative (complement) of the
sum, called the checksum. In this case, we
send (7, 11, 12, 0, 6, −36). The receiver can
add all the numbers received (including the
checksum). If the result is 0, it assumes no
error; otherwise, there is an error. – Use 1’s
Complement arithmetic
Error
CRC generator properties(research)
• It should have at least two terms.
• The coefficient of the term x0 should be 1.
• It should not be divisible by x.
• It should be divisible by x+ 1.
• http://research.ijcaonline.org/volume35/num
ber2/pxc3976032.pdf
Direct questions
• Calculate single parity, VRC for set of data
• Hamming distance, minimum hamming
distance
• Calculate CRC, CRC using polynomial
expression, Hamming Code, Checksum
Problems
• Assume Single Bit Parity Generator,
• Dataword = 1011 codeword = 10111(sender)
– If C.W = 10111, S=?
– If C.W = 10110, S=?
– If C.W = 10001, S=?
– If C.W = 10000, S=?
– If C.W = 01001, S=?
– If C.W = 01000, S=?
– Conclude your interpretation.
Problems
• Imagine a communication link that is
experiencing interference so every 18th bit is
changed from 0 to 1 or from 1 to 0. Does
parity check detect all the errors?
Problem
• How can we represent the number −6 in one’s
complement arithmetic using only four bits?
– Solution 1
• 6 – 0110
• -6 = 1001 = 9
– Solution 2
• 2n-1-no = 16-1-6 = 9
Problem
• calculate the checksum for a text of 8
characters of your name.
• Solution
– Find Ascii value for letters
– Do hex addition
– Calculate Wrapped Sum
– Find Checksum
– Send Receiver side and Do repeat
• Eight bit messages are transmitted using a
Hamming code. How many check bits are
needed to ensure that receiver can detect
and correct single bit errors? Show the bit
• pattern transmitted for the message
1001010. Assume that odd parity is used in
the
• Hamming code.
• ANS:
• m+r+1≤2r , m=8
• 8+r+1≤2r, r=4
• n=m+r=8+4=12
Problem
A bit stream 10101010 is transmitted using the standard CRC method. The
generator polynomial is x3+x2+1. Show the actual bit string transmitted