CH1 Error Detection
CH1 Error Detection
Error Detection
and
Correction
Dr. Abdullah Alrabba
2019
10.1
Note
1.2
Some issues related, directly or indirectly, to error
detection and correction.
1.3
Types of Errors
Single-bit error
Burst error
1.4
In a single-bit error, only 1 bit in the data
Note
unit has changed.
1.5
Note A burst error means that 2 or more bits
in the data unit have changed.
Note
To detect or correct errors, we need to
send extra (redundant) bits with data.
1.7
Coding
1.8
Figure 1.3 The structure of encoder and decoder
1.9
ModularArithmetic
1.10
Figure 1.4 XORing of two single bits or two words
1.11
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.
1.12
Figure 1.5 Datawords and codewords in block coding
1.13
Example
1.1
The 4B/5B block coding is a good example of this type of
coding.
In this coding scheme, k = 4 and n = 5. As we saw, we
have 2k = 16 datawords and 2n = 32 codewords. We saw
that 16 out of 32 codewords are used for message
transfer and the rest are either used for other purposes
or unused.
1.14
Error Detection
1.15
Figure 1.6 Process of error detection in block coding
1.16
Example 1.2
1.17
Example 1.2
1.18
Note
1.19
Figure 1.7 Structure of encoder and decoder in error correction
1.20
Example 1.3
1.23
Example 1.4
1.24
Note
1.25
Example 1.5
1.26
Example 1.6
Solution
1.27
Note
1.28
Example 1.7
1.29
Example 1.8
1.30
Note
1.31
Example 1.9
Solution
1.32
Almost all block codes used today belong to a subset
called linear block codes. A linear block code is a code
in which the exclusive OR (addition modulo-2) of two
valid codewords creates another valid codeword.
1.33
Note
1.34
Example 1.10
1.35
Example 1.11
1.36
Note
1.37
Table 1.3 Simple parity-check code C(5, 4) - n=5, k = 4
1.38
Figure 1.10 Encoder and decoder for simple parity-check code
1.39
Example 1.12
1.41
Note
1.42
Note
1.43
Figure 1.11 Two-dimensional parity-check code
1.44
Figure 1.11 Two-dimensional parity-check code
1.45
Figure 1.11 Two-dimensional parity-check code
1.46
Table 1.4 Hamming code C(7, 4) - n=7, k = 4
1.47
Figure 1.12 The structure of the encoder and decoder for a Hamming code
1.48
Calculating the parity bits at the transmitter:
Modulo 2 arithmetic:
r0 = a2 + a1 + a0
r1 = a3 + a2 + a1
r2 = a1 + a0 + a3
Calculating the syndrome at the receiver:
s0 = b2 + b1 + b0 + q0
s1 = b3 + b2 + b1 + q1
s2 = b1 + b0 + b3 + q2
1.49
Table 1.5 Logical decision made by the correction logic analyzer
1.50
Example 1.13
1.51
Example 1.14
C(15, 11)
1.52
1-4 Burst Errors
1.54
One of the error detection methods is called the
checksum. The checksum is used in the Internet by
several protocols although not at the data link layer.
1.55
Example 1.15
1.56
Example 1.16
1.57
Example 1.17
Solution
The number 21 in binary is 10101 (it needs five bits). We can
wrap the leftmost bit and add it to the four rightmost bits. We
have (0101 + 1) =0110 or 6
1.58
Example 1.18
Solution
In one’s complement arithmetic, the negative complement
of a number is found by inverting all bits. Positive 6 is 0110;
negative is 1001. If we consider only unsigned numbers, this
is 9. In other words, the complement of 6 is 9. Another way
to find the complement of a number is one’s complement
arithmetic is to subtract the number from 2n - 1 (16 - 1) in
this case).
1.59
Example 1.19
1.60
Example 1.19 (continued)
1.61
Figure 1.14 Example 1.19
1 1
1 0
1.62
Note
Sender site:
1. The message is divided into 16-bit words.
2. The value of the checksum word is set to 0.
3. All words including the checksum are
added using one’s complement addition.
4. The sum is complemented and becomes the
checksum.
5. The checksum is sent with the data.
1.63
Note
Receiver site:
1. The message (including checksum) is
divided into 16-bit words.
2. All words are added using one’s
complement addition.
3. The sum is complemented and becomes the
new checksum.
4. If the value of checksum is 0, the message
is accepted; otherwise, it is rejected.
1.64
Example 1.20
1.67