Spring 2024 - CS601 - 2
Spring 2024 - CS601 - 2
02 Total Marks: 20
Semester: Spring 2024
CS601: Data Communication Due Date: 24-June-2024
Instructions:
Please read the following instructions carefully before submitting assignment:
You need to use MS Word document to prepare and submit the assignment on VU-LMS.
It should be clear that your assignment will not get any credit if:
Objective:
Checksum
Hamming Distance
Minimum Hamming Distance
Question No.1
Suppose two devices need to communicate with each other in such a way that the data sent by the sender could be
verified at the receiver side for accuracy. For this purpose, both the sender and the receiver agreed upon the use of
Checksum algorithm at both sides.
Tasks:
1. Calculate the 8-bit checksum for the given data packet at the sender side only.
2. Provide the complete message with the checksum for transmission by the sender.
Solution:
10101000 (sum)
----------
01010111 (one's complement)
1. Complete Message with Checksum:
Append the calculated checksum (01010111) to the end of the data packet:
1101101110101010111100000000111101010111
Question No. 2
Find the hamming distance for the given pair of words. Also find out the minimum Hamming distance from the
given set of words.
Pair of Words Hamming Distance(d)
(11001, 01100)
(10110, 01011)
(11100, 11110)
(01101, 11101)
Minimum Hamming distance
Solution:
(11001, 01100):
1.
1. XOR each corresponding bit: 1 ^ 0 = 1, 1 ^ 1 = 0, 0 ^ 0 = 0, 0 ^ 1 = 1, 1 ^ 0 = 1
2. Count the number of 1s: 1 + 0 + 0 + 1 + 1 = 3 (Hamming Distance)
2. (10110, 01011):
1. XOR each bit: 1 ^ 0 = 1, 0 ^ 1 = 1, 1 ^ 0 = 1, 1 ^ 1 = 0, 0 ^ 1 = 1
2. Count the number of 1s: 1 + 1 + 1 + 0 + 1 = 4 (Hamming Distance)
3. (11100, 11110):
1. XOR each bit: 1 ^ 1 = 0, 1 ^ 1 = 0, 1 ^ 1 = 0, 0 ^ 1 = 1
2. Count the number of 1s: 0 + 0 + 0 + 1 = 1 (Hamming Distance)
4. (01101, 11101):
1. XOR each bit: 0 ^ 1 = 1, 1 ^ 1 = 0, 1 ^ 1 = 0, 0 ^ 1 = 1, 1 ^ 1 = 0
2. Count the number of 1s: 1 + 0 + 0 + 1 + 0 = 2 (Hamming Distance)
2. Minimum Hamming Distance:
Based on the calculations above, the minimum Hamming distance is 1 (occurs between the third pair of words:
11100 and 11110).