11.2 Linear block codes 215
Table 11.2 Syndrome vector S = (s
1
, s
2
, s
3
)
associated with single-error patterns E =
(e
1
, e
2
, e
3
, e
4
, e
5
, e
6
, e
7
) in the Hamming block
code (7, 4) defined in Table 11.1.
Error pattern E Syndrome S
0000000 000
1000000 110
0100000 101
0010000 011
0001000 111
0000100 100
0000010 010
0000001 001
d = 3, respectively. We see from the illustration that the Hamming distance does not
correspond to the Euclidian distance, but rather to the smallest number of square or cube
edges to traverse in order to move from one point to the other.
Going back to our (n, k) = (7, 4) block code example, assume next that the received
block Z contains a single bit error, whose position in the block is unknown. If the error
concerns the first bit of Z = Y + E, this means that the value of the first bit of Y has been
increased (or decreased) by 1, corresponding to the error vector E = (1, 0, 0, 0, 0, 0, 0).
For an error occurring in the second bit, we have E = (0, 1, 0, 0, 0, 0, 0), and so on,
to bit seven. For each single-error occurrence, we can then calculate the corresponding
syndrome vector using the relation S = E
˜
H
T
in Eq. (11.9). The result of the computation
is shown in Table 11.2. It is seen that a unique syndrome corresponds to each error
occurrence. For instance, if the syndrome is S = (0, 1, 1), we know that a bit error
occurred in the third position of the block sequence, and correction is made by adding 1
to the bit (equivalently, by switching its polarity, or by adding E to Z ). Thus any single-
error occurrence (whether in payload or in parity bit fields) can be readily identified and
corrected.
What happens if there is more than one error in the received block? Consider the
case of double errors in our (n, k) = (7, 4) example. The possibilities of a single bit
error correspond to seven different error patterns. For double errors, the number of
possibilities is C
2
7
= 7!/[2!(7 − 2)!] = 21, corresponding to 21 different error patterns.
Since the syndrome is only three bits, it can only take 2
3
− 1 = 7 configurations. Thus,
the syndrome is no longer associated with a unique error pattern. Here, the seven
syndrome configurations correspond to 7 + 21 = 28 error patterns of either one- or two-
bit errors. It is an easy exercise to determine the actual number of error patterns associated
with each syndrome. For instance, the results show that S = (0, 0, 0), S = (0, 0, 1), S =
(0, 1, 1) and S = (1, 0, 1) are associated with one, two, three and four patterns of two-bit
errors, respectively. Thus, syndrome decoding can only detect the presence of errors, but
cannot locate them with 100% accuracy, since they are associated with more than one
error pattern. It is clear that with Hamming codes having greater numbers of parity bits,
this imperfect correction improves in effectiveness, as the mapping E → S becomes