You are on page 1of 7

The Islamic University of Gaza Data Communication

Faculty of Engineering Discussion( Chapter 10 )


Dept. of Computer Engineering
Eng. Ibraheem Lubbad

The Hamming distance between two words (of the same size) is the number of differences
between the corresponding bits
Why Hamming distance is important for error detection?
The reason is that the Hamming distance between the received codeword and the sent codeword
is the number of bits that are corrupted during transmission. if the Hamming distance between
the sent and the received codeword is not zero, the codeword has been corrupted during
transmission.
Q10-6. If we want to be able to detect two-bit errors, what should be the minimum
Hamming distance?
Solution:
To detect s errors, the minimum Hamming distance should be dmin = s + 1
So dmin = 2 + 1= 3

The central concept in detecting or correcting errors is redundancy. To be able to detect or


correct errors, we need to send some extra bits with our data. These redundant bits are added by
the sender and removed by the receiver. Their presence allows the receiver to detect or correct
corrupted bits.
In block coding, we divide our message into blocks, each of k bits, called datawords.
We add r redundant bits to each block to make the length n =k +r. The resulting n-bit blocks are
called codewords.

Q10-8. In Cyclic Redundancy Check (CRC), if the dataword is 5 bits and the codeword is 8
bits, how many 0s need to be added to the dataword to make the dividend? What is the size of
the remainder? What is the size of the divisor?
Solution:
k = 5, n = 8,
codeword size is same as dividend size which is 8 bits. We need to augment the data with three
0’s
Size of the remainder r = n-k = 3 bits , Size of the divisor = r+1 = 4 bits
Q10-10. In CRC, which of the following generators (divisors) guarantees the detection of an odd
number of errors? For each divisor, explain why or why not it would guarantee the detection of
an odd number of errors

a) 10111: this generator is divisible by 11 therefore the quotient will be 1101. It can always
detect odd number of errors.

b) 101101:this generator is divisible by 11 therefore the quotient will be 11011. It can


always detectodd number of errors.

c) 111:this generator is qualified but is not divisible by 11; it can detect odd number of
errors butnot at all times

Q10-11. In CRC, we have chosen the generator 1100101. What is the probability of
detecting a burst error of length?
a) 5?
The term burst error means
b) 7?
that 2 or more bits in the data unit have changed from 1 to 0 or from 0 to 1
c) 10?

Solution:
In this case r = 7 − 1 = 6.
a) The length of the error is L = 5, which means L ≤ r. All burst errors of this size will be
detected.

b) The length of the error is L = 7, which means L = r + 1. This CRC will detect all burst
errors of this size with the probability 1 − (0.5)5 ≈ 0.9688. Almost 312 out of 10,000
errors of this length may be passed undetected.

c) The length of the error is L = 10, which means L > r. This CRC will detect all burst errors
of this size with the probability 1 − (0.5)6 ≈ 0.9844. Almost 156 out of 10,000 errors of
this length may be passed undetected. Although the length of the burst error is increased,
the probability of errors being passed undetected is decreased.
Checksum is an error-detecting technique that can be applied to a message of any
length, used at the network and transport layer rather than the data-link layer
 At the source, the message is first divided into m-bit units. The generator then creates an
extra m-bit unit called the checksum, which is sent with the message
 At the destination, the checker creates a new checksum from the combination of the
message and sent checksum. If the new checksum is all 0s, the message is accepted;
otherwise, the message is discarded
For example, if we send the set of numbers is (7, 11, 12, 0, 6), we send it as (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 message is not
accepted.

Q10-12. Assume we are sending data items of 16-bit length. If two data items are swapped
during transmission, can the traditional checksum detect this error? Explain.
Solution:
No. In this case there two error, but the two errors cannot be detected because the sum and
checksum remain the same.
Q10-13. Can the value of a traditional checksum be all 0s (in binary)? Defend your
answer
Solution:
The value of a checksum can be all 0s (in binary). This happens when the value of the sum (after
wrapping) becomes all 1s (in binary).

P10-10. Assuming even parity, find the parity bit for each of the following data units.
a) 1001011
b) 0001100 The parity bit that is added makes the number of 1s in the codeword even
c) 1000000
d) 1110111
Solution:
1001011  10010111

0001100  00011000

1000000  10000001

1110111  11101110
P10-11. A simple parity-check bit, which is normally added at the end of the word (changing a
7-bit ASCII character to a byte), cannot detect even numbers of errors. For example, two, four,
six, or eight errors cannot be detected in this way. A better solution is to organize the characters
in a table and create row and column parities. The bit in the row parity is sent with the byte, the
column parity is sent as an extra byte

Show how the following errors can be detected:


a) An error at (R3, C3).
b) Two errors at (R3, C4) and (R3, C6).
c) Three errors at (R2, C4), (R2, C5), and (R3, C4).
d) Four errors at (R1, C2), (R1, C6), (R3, C2), and (R3, C6).
Solution:
a) In the case of one error, it can be detected and corrected because the two affected parity
bits can define where the error is.

b) Two errors can definitely be detected because they affect two bits of the column parity.
The receiver knows that the message is somewhat corrupted (although not where). It
discards the whole message.

c) Three errors are detected because they affect two parity bits, one of the column parity and
one of the row parity. The receiver knows that the message is somewhat corrupted
(although not where). It discards the whole message.

d) The last case cannot be detected because none of the parity bits are affected.
Q) Given the dataword 1010011110 and the divisor 10111
a) Show the generation of the codeword at the sender site using binary division
b) Show the checking of the codeword at the receiver site assuming no error has occurred.
c) What is the syndrome at the receiver end if the dataword has an error in the 5th bit
position counting from the right? Namely: dataword 1010001110 is received.
Solution:
a) Binary division case

CRC Checksum was 1010


Codeword was 10100111101010
a) Receiver using binary division:

Remainder was 0000 as required.


If the syndrome is all 0s, there is no error

b) Suppose that we received the corrupted dataword with the old CRC value as
follows: 10100011101010. We can determine the syndrome in this case as:

Non-zero CRC is obtained. CRC = 0010 , there is error.


the remainder of the division is the syndrome. If the syndrome is all 0s, there is no
error
P10-12. Given the dataword 10100111 and the divisor 10111, show the generation of
the CRC codeword at the sender site (using binary division).
Solution:

You might also like