Error Correcting Codes: - 34 - R-E-S-O-N-A-N-C-E-I - Ja-n-u-a-rY - 19-9-7
Error Correcting Codes: - 34 - R-E-S-O-N-A-N-C-E-I - Ja-n-u-a-rY - 19-9-7
Priti Shankar
-34-------------------------------~-------------R-E-S-O-N-A-N-C-E-I--Ja-n-u-a-rY--19-9-7
SERIES , ARTICLE
-RE-S-O-N-A-N-C-E--' -Ja-n-u-a-rY--19-9-7------------~------------------------------~-
SERIES I ARTICLE
In a code where Thus, if the message bits are 1010, then the codeword is 1010011.
each codeword After the message sequence is encoded into the codeword c, the
contains several codeword is transmitted across the noisy channel. The channel
message bits and adds to the codeword, an error pattern e = (eo' el'." e6 ) to yield
several check bits, the received pattern r = c+e. Thus, for example, if the bit with
each check bit index 4 of the codeword above is garbled by the channel, the
must be some error pattern is 0000100, and. the received pattern is 1010 111.The
function of the decoder then has to estimate the original message from the
message bits. garbled codeword.
Co + c} + c2 + c4 == 0 (mod 2 )
Co + c} + c3 + Cs == 0 (mod 2 )
Co + c2 + c3 + c6 == 0 (mod 2 )
Co
C1
~l
1 1 0 1 0 c2
c3
m
1 0 1 0 1
[l 1 1 1 0 0 c4
Cs
c6
The first matrix on the left hand side is called the parity check
matrix H. Thus every codeword c satisfies the equation
_ _ _ _ _ _ _ _,AA~~AA_ _- -_ _ _ _
Things to Remember
Binary block code: A collection of codewords. Each codeword is a fixed length pattern of O's and l's.
k: The number of message bits in each codeword.
r: The number of check bits in each codeword.
n : The block length of the code. n = k + r
Information Rate of a code: The ratio k / n
Hamming distance between codewords. The number of corresponding positions in which the codewords
differ.
Minimum distance of a code: The minimum of the Hamming distances between all pairs of codewords.
Hamming weight of a vector: Number of non-zero components of the vector.
Result: A linear code can correct all error patterns of Hamming weight 1 or less if and only if it has a
minimum distance at least 21+ 1. It can detect all error patterns of weight d or less if and only if it has
a minimum distance at least d + 1.
Syndrome Decoding
-RE-S-O-N-A-N-C-E--I-J-a-nu-a-r-Y-1-99-7-------------~-------------------------------3-7
SERIES I ARTICLE
The syndrome, Suppose a single error has occurred during transmission. Then
reveals the pattern the error pattern will have a single 1 in the position in which the
of parity check error has occurred and zeros everywhere else. Thus the product
failures on the He T will be the i th column of H if i is the error position. Since
received pattern. the seven columns of Hare all the distinct non-zero combinations
of three bits, each of the seven possible single errors will have a
distinct syndrome which will unilJ.\lely identify it. For example,
if the bit with index 4 is in error, the error pattern is 0000100,
and the syndrome will be 100 (the column of H with index 4, if
the columns are indexed beginning with 0). Since the single
error syndromes by themselves exhaust all the seven possible
non-zero syndromes (there are only seven non -zero combinations
of three bits), any double error will necessarily have the same
syndrome as that of a single error. For example, the double error
pattern 0010001, among others, also gives the syndrome 100.
How does the decoder decide which error pattern to choose?
_ _ _ _ _ _ _ _LAAnAA,~_ _ _ __ _
38 v V VVV v RESONANCE I January 1997
SERIES I ARTICLE
syndrome matches. If the column index is i, then the estima- The parity check
ted error pattern e is the vector with a 1 in the ith position matrix of a code
and zeros everywhere else. provides us with a
means of
3. Form c = r +e as the decoder's estImate of the transmitted determining a
codeword. lower bound on the
minimum distance
Problem of the code,
without either
For the length 7 Hamming code defined above, decode the having to examine
received vectors r = (1110000), r = (1111000). all pairs of
codewords or
The Minimum Distance of a Code looking at
syndromes.
The last result in the table displayed indicates that since this
Hamming code can correct all single errors, the minimum
distance of the code must be at least three. Actually we can
deduce that there is a codeword of Hamming weight three from
the example given earlier, where flipping one bit in a codeword
could give the same syndrome as is obtained by flipping two
other bits in some other codeword. For if e 1 and e 2 are the
single and double error patterns respectively, that give the same
syndrome, then H e/ = He/ or H( e 1 +e2? = O. Thus e 1 +e 2
is a codeword with exactly three l's i.e. it has Hamming weight
three, and is at distance three from the all zero codeword. The
parity check matrix of a code provides us a means of determining
a lower bound on the minimum distance of the code, without
either having to examine all pairs of codewords or looking at
syndromes.
-Ja-n-u-a-rY--19-9-7------------~------------------------------3-9
-RE-S-O-N-A-N-C-E--I
SERIES I ARTICLE
A code is normally vector. But this can happen only if the columns are identical.
characterized by Since all columns are distinct, the weight must be at least three.
three parameters: We have thus found a rule to obtain a lower bound on the
the length, the minimum distance of a linear code from its parity check matrix
number of H.
information
symbols, and the If no linear combination of d or fewer columns of H gives the all zero
minimum column vector, then the code has minimum distance at least d + 1.
distance.
A code is normally characterized by three parameters. These are
the length n, the number of information symbols k, and the
minimum distance d. A code with these parameters is called a
(n, k, d ) code.
Problem
-40------------------------------~-------------R-ES-O-N-A-N-C-E--I-Ja-n-u-a-rY--19-9-7
SERIES I ARTICLE
o
o
H'= H
o
1 1 1 1
Problem
-R-ES-O-N-A-N-C-E--I-Ja-n-u-a-rY--19-9-7------------~------------------------------4-1
SERIES I ARTICLE
_ _ _ _ _ _ _ _ "A~~~A,_ _ _ _- - - -
errors, and corrects all single errors. Step 2 of the decoding Suggested Reading
algorithm above would be modified as follows: If the syndrome
is the all 0 vector, then assume that no errors have occurred. If • Robert J McEliece. The
Theory of Information and
the syndrome matches the ith column of H, then estimate the
Coding. Encyclopedia of
error as the pattern with a 1 in positioni and zeros everywhere Mathematics and its
else. If the non-zero syndrome does not match any column ofH Applications. Addison
then report a decoding failure, i.e. the detection of an Wesley, 1977.
un correctable error.
• J H Van Lint. Introduction
to Coding Theory. Graduate
Since all double errors have non-zero syndromes, the extended Texts in Mathematics.
Hamming code is said to be single error correcting double error Springer-Verlag, 1992.
detecting, (that is, it can do both these things simultaneously).
Note the difference between this Hamming code and the length
7 Hamming code. If the latter code was used for single error
correction, it could not simultaneously detect double errors as the
syndromes for single and double errors were not distinct.
Similarly, the length 8 Hamming code cannot simultaneously
correct single errors and detect triple errors.
Problem
For the length 8 Hamming code above, show that the spheres of
Hamming radius 2 around codewords are not disjoint.
Address for Correspondence
Priti Shankar
Single error correction is obviously not enough for most Department of Computer
applications. In the next article we will study the powerful Reed Science and Automation
Solomon codes which were invented in 1960. Though these Indian Institute of Science
Bangalore 560 012, India
started off as mathematical curiosities, a clever decoding
email:priti@csa.iisc.ernet.in
algorithm invented about eight years later has made them perhaps Fax: (080) 334 1683
the most practical and widely used codes.
-R-ES-O-N-A--N-C-E-I-J-a-n-u-a-rY--19-9-7----------~-~~-------------------------------4-3