CHECKSUM (Error Detection Method)
Original Data (n = 32) → 10011001 11100010 00100100 10000100
K = 4
M = n/k = 8
Transmitter:
10011001
11100010
101111011
1
01111100 → Result 1
00100100
10100000 → Result 2
10000100
100100100
1
00100101 → Result 3 (Final Addition)
11011010 (1’s Complement of Final Result, called Checksum)
Checksum → 11011010
New Transmitted Data →
10011001 11100010 00100100 10000100 11011010
Receiver:
10011001
11100010
101111011
1
01111100 → Result 1
00100100
10100000 → Result 2
10000100
100100100
1
00100101 → Result 3
11011010
11111111 → Result 4
00000000 → 1’s Complement
If 1’s complement is all zeros, then received data is true
Q. If received data is 10011001 11100010 00100100 10000100 01011010
Now, check weather the data is right or wrong
Q. If the original data is 11000110 00110011 10101010 11110000, so what
the resultant transmitted data you will form by using checksum.
(Homework Part)
Error Correction Method:
Hamming Code Method
Original Data (n)
No of Parity Bit (k)
Total length of transmitted data (l = n+k)
To calculate the value of k
2k
>= k+n+1 (we will take the minimum possible value for k)
n = 4,
2k
>= k+4+1
2k
-k >= 5
K = 0
Not satisfy the eqn
K = 1
K = 2
K = 3, satisfying the eqn
N = 4,
K= 3,
L = 7
Ex:
1010 (n = 4)
Positions of k = 2k
; {k = 0, 1……. (k-1)}
Positions of k = 1, 2, 4
Total length of data = l = n+k
1 2 3 4 5 6 7
P1 P2 n1 P3 n2 n3 n4
P1 P2 1 P3 0 1 0
We have to find the value of P1, P2 & P3
Octal Number System (0 to 7)
c3c2c1
ABC → No
000 → 0 (Homework Part)
001 → 1
010 2
011 3
100 4
101 5
110 6
111 7
p1 -→ c1 {1, 3, 5, 7}
p2 -> c2 {2, 3, 6, 7}
p3 → c3 {4, 5, 6, 7}
1 2 3 4 5 6 7
P1 P2 1 P3 0 1 0
1 0 1 1 0 1 0 Transmitted Data (Even)
0 1 1 0 0 1 0 Transmitted Data (Odd)
Data (1010) Hamming Code (1011010) using even parity
Data (1010) Hamming Code (0110010) using odd parity
Even Parity Odd Parity Methods
P1 { - 1 0 0} { 1 1 0 0 } { 0 1 0 0 }
P2 { - 1 1 0} { 0 1 1 0 } { 1 1 1 0 }
P3 { - 0 1 0} { 1 0 1 0 } { 0 0 1 0 }
Ex:
Received Data is: 1111010, on even parity
1 2 3 4 5 6 7
1 1 1 1 0 1 0
P1 P2 n1 P3 n2 n3 n4
p1 → c1 {1, 3, 5, 7} {1 1 0 0} c1 = 0
p2 -> c2 {2, 3, 6, 7} {1 1 1 0} c2 = 1
p3 → c3 {4, 5, 6, 7} {1 0 1 0} c3 = 0
010 → error position → (2)
Received Data is wrong at 2nd
bit position
Correct Data is: 1011010
Q. If the received data is: 0111010, you have to check on odd parity that
this data is correct or not. If it is wrong then correct it.
1 2 3 4 5 6 7
0 1 1 1 0 1 0
P1 P2 n1 P3 n2 n3 n4
p1 -→ c1 {1, 3, 5, 7} {0100} c1 → 0
p2 -> c2 {2, 3, 6, 7} {1110} c2 → 0
p3 → c3 {4, 5, 6, 7} {1010} c3 → 1
100 → 4 (error position)
Correct Data: 0110010
Data (1010) Hamming Code (0110010) using odd parity
Q. Original Data: 1110
Form Hamming Code using Even & Odd Parity Method.
Q. Received Data is: 1100110, check weather this data is correct or not? If
it is wrong, correct it.
Checksum & Hamming Code

Checksum & Hamming Code

  • 1.
    CHECKSUM (Error DetectionMethod) Original Data (n = 32) → 10011001 11100010 00100100 10000100 K = 4 M = n/k = 8 Transmitter: 10011001 11100010 101111011 1 01111100 → Result 1 00100100 10100000 → Result 2 10000100 100100100 1 00100101 → Result 3 (Final Addition) 11011010 (1’s Complement of Final Result, called Checksum) Checksum → 11011010 New Transmitted Data → 10011001 11100010 00100100 10000100 11011010 Receiver: 10011001 11100010 101111011
  • 2.
    1 01111100 → Result1 00100100 10100000 → Result 2 10000100 100100100 1 00100101 → Result 3 11011010 11111111 → Result 4 00000000 → 1’s Complement If 1’s complement is all zeros, then received data is true Q. If received data is 10011001 11100010 00100100 10000100 01011010 Now, check weather the data is right or wrong Q. If the original data is 11000110 00110011 10101010 11110000, so what the resultant transmitted data you will form by using checksum. (Homework Part) Error Correction Method: Hamming Code Method Original Data (n) No of Parity Bit (k) Total length of transmitted data (l = n+k) To calculate the value of k 2k >= k+n+1 (we will take the minimum possible value for k) n = 4,
  • 3.
    2k >= k+4+1 2k -k >=5 K = 0 Not satisfy the eqn K = 1 K = 2 K = 3, satisfying the eqn N = 4, K= 3, L = 7 Ex: 1010 (n = 4) Positions of k = 2k ; {k = 0, 1……. (k-1)} Positions of k = 1, 2, 4 Total length of data = l = n+k 1 2 3 4 5 6 7 P1 P2 n1 P3 n2 n3 n4 P1 P2 1 P3 0 1 0 We have to find the value of P1, P2 & P3 Octal Number System (0 to 7) c3c2c1 ABC → No 000 → 0 (Homework Part) 001 → 1 010 2 011 3
  • 4.
    100 4 101 5 1106 111 7 p1 -→ c1 {1, 3, 5, 7} p2 -> c2 {2, 3, 6, 7} p3 → c3 {4, 5, 6, 7} 1 2 3 4 5 6 7 P1 P2 1 P3 0 1 0 1 0 1 1 0 1 0 Transmitted Data (Even) 0 1 1 0 0 1 0 Transmitted Data (Odd) Data (1010) Hamming Code (1011010) using even parity Data (1010) Hamming Code (0110010) using odd parity Even Parity Odd Parity Methods P1 { - 1 0 0} { 1 1 0 0 } { 0 1 0 0 } P2 { - 1 1 0} { 0 1 1 0 } { 1 1 1 0 } P3 { - 0 1 0} { 1 0 1 0 } { 0 0 1 0 } Ex: Received Data is: 1111010, on even parity 1 2 3 4 5 6 7 1 1 1 1 0 1 0 P1 P2 n1 P3 n2 n3 n4 p1 → c1 {1, 3, 5, 7} {1 1 0 0} c1 = 0 p2 -> c2 {2, 3, 6, 7} {1 1 1 0} c2 = 1 p3 → c3 {4, 5, 6, 7} {1 0 1 0} c3 = 0
  • 5.
    010 → errorposition → (2) Received Data is wrong at 2nd bit position Correct Data is: 1011010 Q. If the received data is: 0111010, you have to check on odd parity that this data is correct or not. If it is wrong then correct it. 1 2 3 4 5 6 7 0 1 1 1 0 1 0 P1 P2 n1 P3 n2 n3 n4 p1 -→ c1 {1, 3, 5, 7} {0100} c1 → 0 p2 -> c2 {2, 3, 6, 7} {1110} c2 → 0 p3 → c3 {4, 5, 6, 7} {1010} c3 → 1 100 → 4 (error position) Correct Data: 0110010 Data (1010) Hamming Code (0110010) using odd parity Q. Original Data: 1110 Form Hamming Code using Even & Odd Parity Method. Q. Received Data is: 1100110, check weather this data is correct or not? If it is wrong, correct it.