Chapter - 2 (Error control)
Chapter - 2 (Error control)
error control
if data received is not same as the data sent then this means error has occured.
types of error :
(i) single-bit error
example :
b= 1kbps = 103bits/second
noise duration = 1/10sec
number of corrupted bits (or) affected bits = 103bits/second x 1/10sec = 100bits
formula :
number of corrupted bits = bandwidth * noise duration
(number of corrupted bits or affected bits depends on the data rate and duration of noise)
concept : redundancy
receiver can only detect receiver can detect + how many and
which bits are changed
(a) datawords : k
- combinations : 2k
(b) redundant bits : r
(c) codeword(n) = k+r
- combinations : 2k
(d) invalid codeword : 2k-2n
(i) if the recieved codeword is same as the one of the valid codeword, the word is accepted.
no error
000 000 valid codeword (accepted by receiver)
sender receiver
(iii) the codeword is corrupted during transmission but the recieved word still matches a valid
codeword, the error remains undetected.
error because
sent : 000
recieved : 011
sender reciever
sender reciever
sender reciever
formula :
(i) if minimum hamming distance = d
then we can detect upto (d-1) bit error.
(ii) to detect "d" bit error, minimum hamming distance required = d+1
(i) simple parity concept one extra bit (parity bit) is added to each data word.
(ii) simple parity check can detect all single bit error.
(iii) simple parity check can not detect an even number of errors, but it can detect an odd
number of errors.
k=2 bit
r=1
codeword (n) = k+r = 2+1=3
codeword (valid)
000
011 codeword not
101 available
110
codeword (valid)
000
011
101
110 codeword available
codeword (valid)
000
011 codeword not available
101
110
1st row 2nd row 3rd row 4th row 5th row
number of rows : 5
number of columns : 6
0 row parity
1
1
1
0
0 1 0 0 0 0 1
column parity
number of rows : 6
number of columns : 7
transmitted 0100001
data :
6th row
it is 1 instead
original :
of 0 means
there is error
in bits
original :
- it can detect two bit but cannot correct two bit error.
- two bit error will effect maximum 4 parity.
(1011: 2 row + 2 column)
- kisi bhi 2 bit mai change karne par wahi same distrubance
hoga. saari bits change karne par bhi islie not able to find
kaunse bits ki wajah se error hoga.
original :
- it can detect three bit error but cannot correct three bit error.
original :
- three bit error will effect minimum 2 parity.
(01 : 1 row + 1 column)
original :
it can and sometimes cannot detect 4 bit error
disadvantages of 2d parity :
- if we have a error in the parity then this scheme does not work fine.
1
error in parity (it should be 0)
minimum number of
1's in a non-zero valid
code word :
- valid code words:
011 : 2
101 : 2
110 : 2
(ii) assume this is a linear block code : minimum number of 1's in a non-zero valid code word :
000 - valid code words:
001 000 : 0
110 001 : 1
111 110 : 2
010 111 : 3
011 010 : 1
011 : 2
point to remember :
crc must be k-1 bits
example :
data = 1001001
divisor or crc generator = 1101
1101|1001001111
1101
0100001111
1101
010101111
1101
01111111
1101
0010111
1101
01101
1101
0000 syndrome = 0 (no error)
dataword accepted.
example :
dataword d(x) = 1001001
divisor (or) generator g(x) = 1101
error
error
1 bit error
e(x) = x3
1 0 0 0 e(x) = 1000
error = 1000
sent codeword : 1 1 0 1 0 0 1 1 0 1
recieved
codeword : 1 1 0 1 0 0 0 1 0 0
x3 x0
c(x): 1 1 0 1 0 0 1 1 0 1 1 0 0 1 e(x) = x3 + x0
e(x) = 1001
1101001101
1001 (-)
1101000100
e(x)
=0
g(x)
1001
=0
1001
point to remember :
(i) crc is not perfect scheme if e(x) is divisible by g(x) then that error cannot be detected
(ii) probability of such error is very less, hence error detection probability of crc is very high.
syndrome : s(x)
(i) if s(x)≠0, then code word is rejected and crc scheme is working fine.
(ii) if s(x)=0 and e(x)=0 then code word is accepted and crc scheme is working fine.
(iii) if s(x)=0 and e(x)≠0 [e(x) is divisible by g(x)] then codeword accepted and scheme failed
to detect the error.
point to remember :
last bit ki error ko chodkar saari error even number de rahi hai (in single bit)
if e(x) = 10 - [2nd bit error] ; 2
if e(x) = 100 - [3rd bit error] ; 4
if e(x) = 1000 - [4th bit error] ; 8
if e(x) = 10000 - [5th bit error] ; 16
if e(x) = 100000 - [6th bit error] ; 32
g(x) = 10 ; 2
Chapter - 2 (Error control) Page 21
g(x) = 10 ; 2
g(x) = 100 ; 4
g(x) = 1000 ; 8
g(x) = 10000 ; 16
problem : except for last bit error, single bit error gives even number so divisor must not be
even. if divisor is also even then remainder will be zero, so we can not caught single bit
error.
solution : to detect all single bit error the last bit of the divisor must be 1, so that divisor
becomes an odd number and hence all single bit error detected.
points to remember :
(i) if the generator has more than one term (x+1) and coefficient of x 0 is 1, all single bit error
can be detected.
(ii) if generator cannot divide x t+1 (t between 0 and n-1) then all isolated double error can be
detected.
(iii) a generator that contains a factor of x+1 can detect all odd numbered errors.
example :
(i)generator = 1
data : 1011
it is invalid generator, r : 0 (no redundant bits)
(ii)generator = x : x1.1+x0.0 = 10
data : 1011
sender : 10 10110
10
00110
10
010
10
00 crc (or) remainder
reciever : 10 10010
10
Chapter - 2 (Error control) Page 22
10
00010
10
00 syndrome = 0 (dataword accepted)
crc failed to detect error.
e(x) = x2 = 100(4)
g(x) = 10 (2)
e(x) = 100
0
g(x) = 10 =
point to remember :
g(x) should not contain 'x'
sender : 11 10110
11
01110
11
0010
11
01 crc (or) remainder
reciever : 11 10101
11
01110
11
0010
11
01 syndrome ≠ 0 (dataword rejected)
crc passed to detect error.
e(x) = x1 = 10(2)
g(x) = 11 (3)
e(x) = 10
0
g(x) = 11 ≠
- message = m bits
- n(codeword)=m(dataword)+r(redundant/check/parity bits)
example :
- dataword/message : 1010111, m = 7
m+r+1 ≤ 2r
11bits : 1 2 3 4 5 6 7 8 9 10 11
positions : 1, 2, 4, 8
p1 p2 3 p4 5 6 7 p8 9 10 11
1010111 : 1 0 1 0 1 1 1
- calculating p1 : - calculating p2 :
choose 1 bit and skip 1 bit start from 2, choose 2 bit and skip 2 bit
p1 3 5 7 9 11 p2 3 6 7 10 11
1 0 0 1 1 1 1 0 1 1
p1 3 5 7 9 11 p2 3 5 7 10 11
1 1 0 0 1 1 0 1 1 0 1 1
- calculating p4 : - calculating p8 :
start from 4, choose 4 bit and skip 4 bit start from 8, choose 8 bit and skip 8 bit
p4 5 6 7 p8 9 10 11
0 1 0 1 1 1
p4 5 6 7 p8 9 10 11
1 0 1 0 1 1 1 1
- 1011
p1 p2 3 p4 5 6 7 p8 9 10 11
1 0 1 1 0 1 0 1 1 1 1
codeword : 10110101111
1 2 3 4 5 6 7 8 9 10 11
transmitted data : 1 0 1 1 0 1 0 1 1 1 1
p1 : p2 :
1 3 5 7 9 11 2 3 6 7 10 11
1 1 0 0 1 1 0 1 1 0 1 1
number of 1's : even (o) number of 1's : even (o)
p4 : p8 :
4 5 6 7 8 9 10 11
1 0 1 0 1 1 1 1
number of 1's : even (o) number of 1's : even (o)
p8 p 4 p 2 p 1
0 0 0 0 sabki value 0, no error.
p4 : p8 :
4 5 6 7 8 9 10 11
1 0 1 0 1 0 1 1
number of 1's : even (o) number of 1's : odd(1)
p8 p4 p2 p1
1 0 0 1 1, error.
decimal value : 1001 = 9
error in 9th bit, 9th bit got corrupted.
p1 : p2 :
1 3 5 7 9 11 2 3 6 7 10 11
1 1 1 0 0 1
Chapter - 2 (Error control) Page 26
p1 : p2 :
1 3 5 7 9 11 2 3 6 7 10 11
1 1 1 0 0 1 0 1 1 0 1 1
number of 1's : even (0) number of 1's : even (o)
p4 : p8 :
4 5 6 7 8 9 10 11
1 1 1 0 1 0 1 1
number of 1's : odd(1) number of 1's : even(0)
p8 p4 p2 p1
1 1 0 0 1, error.
decimal value : 1100 = 12
error in 12th bit, 12th bit does not exist.
point to remember :
if parity is not given then odd parity is preferable over even parity.
dataword : 01111011110000000110
lets assume checksum = 4bit.
dataword : 0111 1011 1100 0000 0110
decimal : 7 11 12 0 6
checksum : 7+11+12+0+6=36
technique (i) : send the data along with checksum, reciever will divide checksum into 4 bits and
calculate the sum, if the sum of checksum(sent) is equal to checksum(reciever) then no error.
transmitted data : 01111011110000000110 36
checksum
technique (ii) : send the data along with checksum, reciever will recieve the checkum in negative, if
the difference between checksum is 0 then no error.
but there is a problem with both techniques, the maximum bits we can store in 4 bits is 15 (1111) but
the checksum is 36.
100100
+10
0110
1001 one's complement
101101
+10
1111
0000 one's complement
all zero : no error