You are on page 1of 24

# EE 605: Error Correcting Codes

Instructor: Saravanan Vijayakumaran
Indian Institute of Technology Bombay
Autumn 2011

Assignment 1 : 20 points

Due date: August 4, 2010

Each of the following exercises is worth 5 points. Every nontrivial step in a proof should
be accompanied by justification.
1. Prove that the Hamming distance satisfies the triangle inequality, i.e. d(u, v) ≤
d(u, w) + d(w, v) for all n-tuples u, v, w.
2. Calculate the crossover probability of the binary symmetric channel which is equivalent to the system below.
BSC(p)

Binary
Input

BSC(p)

BSC(p)

Majority
function

BSC(p)

Binary
Output

BSC(p)

3. Derive the optimal decoding rule for a 2n-repetition code for use over a binary symmetric channel with crossover probability p. Is the optimal decoding rule unique?
Calculate the average probability of error for this code when the optimal decoding
rule is used.
4. Consider a binary block code C of length n having minimum distance dmin where dmin
is an odd integer. Show that when a overall parity bit is added to all the codewords
in C we obtain a code of length n + 1 and minimum distance dmin + 1.

EE 605: Error Correcting Codes
Instructor: Saravanan Vijayakumaran
Indian Institute of Technology Bombay
Autumn 2011

Solutions to Assignment 1
1. Prove that the Hamming distance satisfies the triangle inequality, i.e. d(u, v) ≤
d(u, w) + d(w, v) for all n-tuples u, v, w.
Solution: For a set A, let |A| denote its cardinality. We know that |A∪B| ≤ |A|+|B|
and |A| ≤ |A ∪ B|. Also, if |A| ≤ |B| then |Ac | ≥ |B c |.
Note that d(u, v) = |A| where A = {i|ui 6= vi }.
Ac
⇒ Ac
⇒ |Ac |
⇒ |A|
⇒ |A|
⇒ d(u, v)

=
=

{i|ui = vi }
{i|ui = vi = wi } ∪ {i|ui = vi 6= wi }
|{i|ui = vi = wi }| = |{i|ui = wi } ∩ {i|vi = wi }|
|{i|ui = wi }c ∪ {i|vi = wi }c | = |{i|ui 6= wi } ∪ {i|vi 6= wi }|
|{i|ui 6= wi }| + |{i|vi 6= wi }|
d(u, w) + d(w, v)

2. Calculate the crossover probability of the binary symmetric channel which is equivalent to the system below.
BSC(p)

Binary
Input

u

BSC(p)

v

BSC(p)

w1
w2

Majority
function

x

BSC(p)

y

Binary
Output

w3
BSC(p)

Solution: The crossover probability of the equivalent binary symmetric channel is
Pr[u 6= y].
Pr[u 6= y] = Pr[u 6= v] Pr[v = y] + Pr[u = v] Pr[v 6= y]
= (1 − p) Pr[v = y] + p Pr[v 6= y]
= (1 − p) {Pr[v 6= x] Pr[x 6= y] + Pr[v = x] Pr[x = y]}
+p {Pr[v 6= x] Pr[x = y] + Pr[v = x] Pr[x 6= y]}
= (1 − p) {Pr[v 6= x]p + Pr[v = x](1 − p)} + p {Pr[v 6= x](1 − p) + Pr[v = x]p}
= 2p(1 − p) Pr[v 6= x] + [p2 + (1 − p)2 ] Pr[v = x]

w2 .The calculation is complete if we can calculate Pr[v = x] which is equal to the probability that at most one of w1 . Thus the optimal decoder is not unique. For each received vector. The average probability of error of the minimum distance decoder is    2n  X 2n i 1 2n n 2n−i p (1 − p)n Pe = p (1 − p) + 2 n i i=n+1 4. Since dmin is odd. Derive the optimal decoding rule for a 2n-repetition code for use over a binary symmetric channel with crossover probability p. But every received vector which has n zeros and n ones is equidistant to the all zeros and all ones codewords. the distance between them will remain the same if their parity bits are the same or increase by one if their parity bits are different. Is the optimal decoding rule unique? Calculate the average probability of error for this code when the optimal decoding rule is used. Now consider any pair of codewords which are not a minimum distance dmin . Show that when a overall parity bit is added to all the codewords in C we obtain a code of length n + 1 and minimum distance dmin + 1. Consider a binary block code C of length n having minimum distance dmin where dmin is an odd integer. We decide the all zeros codeword was sent if the distance of the received vector to it is smaller and the all ones codeword was sent otherwise. Such received vectors can be decoded as either codeword without changing the average probability of error. v which are at a distance dmin from each other. So they will still be at a distance of at least dmin + 1. Hence the minimum distance of the new code is dmin + 1. 2 . Solution: Consider any pair of codewords u. For example. its distance to the all zeros and all ones 2n-tuples is calculated. u and v differ in an odd number of locations. the optimal decoding rule for the 2n-repetition code over a BSC is the minimum distance decoding rule. They are at a distance of at least dmin + 1. If we add an Pnto u and v. w3 is different from v because the majority function can correct at most one error. After the addition of the overall parity check bit. suppose Pnoverall parity bit v = 0. their parity bits will differ. Solution: If the codewords are equally. then i=1 ui has to be 1 since we are changing an odd number of terms i=1 i in the summation. This probability is equal to (1−p)3 +3p(1−p)2 . So any pair of codewords in C which are at a distance dmin will be at a distance dmin + 1 after the addition of the overall parity check. 3.

A burst error of length l is an error pattern which causes l consecutive locations in the transmitted code to be corrupted. Derive the generator matrix of C1 ⊕C2 in terms of the generator matrices of C1 and C2 . 2011 Each of the following exercises is worth 5 points. Prove that (a) (C ⊥ )T = (C T )⊥ (b) (C ⊥ )T = (CT )⊥ 4. Show that C1 ⊕ C2 is a (n1 + n2 . . Construct the standard array and syndrome decoding table for the (7. Let C be (n. . k2 ) binary linear block code with minimum distance d2 . k1 ) binary linear block code with minimum distance d1 and let C2 be a (n2 .EE 605: Error Correcting Codes Instructor: Saravanan Vijayakumaran Indian Institute of Technology Bombay Autumn 2011 Assignment 2 : 20 points Due date: August 30. . (a) What is the necessary and sufficient condition on the columns of H so that every burst error of length up to t can be detected? (b) What is the necessary and sufficient condition on the columns of H so that every burst error of length up to t can be corrected? 3. Every nontrivial step in a proof should be accompanied by justification. n}. c2 )kc1 ∈ C1 . Let H be the parity check matrix of a binary linear block code. Let C T be the code obtained by puncturing C on the coordinates in T and let CT be the code obtained by shortening C on the coordinates in T . c2 ∈ C2 }. Let T be a set of coordinates of the codewords i. 2. 4) linear block code with generator matrix   1 0 0 0 0 1 1 0 1 0 0 1 0 1   0 0 1 0 1 1 0 0 0 0 1 1 1 1 2. The direct sum of C1 and C2 is defined as C1 ⊕ C2 = {(c1 . d2 ). Let C1 be a (n1 . k1 + k2 ) linear block code with minimum distance min(d1 . . k) linear code. .e. Derive the parity check matrix of C1 ⊕ C2 in terms of the parity check matrices of C1 and C2 . T ⊆ {1. 1.

. Construct the standard array and syndrome decoding table for the (7. . . Thus every burst of length two can be detected by a scheme which declares an error detection whenever a nonzero syndrome is observed.EE 605: Error Correcting Codes Instructor: Saravanan Vijayakumaran Indian Institute of Technology Bombay Autumn 2011 Solutions to Assignment 2 1. 3. t consecutive columns is not zero. 4) linear block code with generator matrix   1 0 0 0 0 1 1 0 1 0 0 1 0 1   0 0 1 0 1 1 0 0 0 0 1 1 1 1 Solution: The standard array is given in Table 1 and the syndrome decoding table is given in Table 2. then every burst error of length upto t can be detected. Similarly if no 3. A burst error of length l is an error pattern which causes l consecutive locations in the transmitted code to be corrupted. t consecutive columns in H add up to zero. The parity check matrix which is given by   0 1 1 1 1 0 0 H = 1 0 1 1 0 1 0 1 1 0 1 0 0 1 The syndrome decoding table is obtained by multiplying the coset leaders in the standard array by H T . . We claim that the above sufficient condition is also necessary. . Let H be the parity check matrix of a binary linear block code. then every error pattern of weight 1 will be detected by a scheme which declares an error detection whenever a nonzero syndrome is observed. then no error pattern with 2 consecutive ones will result in a zero syndrome. Suppose no 2 consecutive columns in H add up to zero. . Suppose H has no zero columns.. Consider an error detection scheme which is capable of detecting burst errors of length upto t. .. If r = v+e where v is the transmitted codeword and e is the error vector. Thus a sufficient condition for detecting a burst of length upto t is that H has no zero columns and the sum of any 2. rH T = eH T . (a) What is the necessary and sufficient condition on the columns of H so that every burst error of length up to t can be detected? Solution: We know that the syndrome of a received vector is equal to the syndrome of the error pattern. 4. 2.

it is necessary for vi + e to be in Ai where e is a burst error of length upto t. . Any error correction scheme for an (n. i = 1. Let T be a set of coordinates of the codewords i. . we decode it as the codeword vi . 2k each of which corresponds to a codeword. If r ∈ Ai . 2. Then u is obtained by shortening a vector v in C ⊥ on the coordinates in T . Since e ∈ / C ⇐⇒ eH T 6= 0. Setting both e1 and e2 to be weight one error patterns we see that all the columns of H are necessarily distinct. A burst error vector e of length upto t can be identified from the syndrome (due to the uniqueness) and the errors introduced can be corrected by adding e to r. . n}. k) linear code. rH T = eH T = s. we get e1 H T 6= e2 H T for any two distinct burst errors of length upto t. This is sufficient to correct any burst error of length upto t because each one of these burst errors corresponds will result in a distinct syndrome (because it is a sum of columns). Since the scheme should not declare an error when the error pattern e is the all zeros vector i. . So v is zero in the coordinates specified by T . When e is an error pattern of weight two or more. 3. . If r = v + e where v is the transmitted codeword and e is the error vector. eH T corresponds to a sum of columns in H which needs to be necessarily distinct for different values of e. If we set e1 to be a weight one error pattern and e2 = 0. . we have vi + e1 6= vj + e2 where i 6= j and e1 . Since 2 . . . t consecutive columns add up to a distinct vector. Multiplying both sides by H T . . 2. (b) What is the necessary and sufficient condition on the columns of H so that every burst error of length up to t can be corrected? Solution: Suppose that all the columns of H are nonzero and distinct. Also suppose that the sum of any 2. k) block code C is a partition of the space Fn2 into two subsets E and E c such that an error detection is declared when the received vector r ∈ E. Since the scheme is capable of correcting burst errors of length upto t. we see that e1 H T 6= 0 which means that all the columns of H are necessarily nonzero. To prove the necessity of the above condition. . Let C T be the code obtained by puncturing C on the coordinates in T and let CT be the code obtained by shortening C on the coordinates in T . 3. Since the Ai ’s are disjoint. Thus it is necessary that there are no nonzero columns in H and no 2. Thus an error is not detected whenever r ∈ C. .e. Since v + e ∈ / C if and only if e ∈ / C. it is necessary that eH T is not equal to zero for any burst error e of length up to t. Prove that (a) (C ⊥ )T = (C T )⊥ Solution: Let u ∈ (C ⊥ )T . .e. when r = v.Any error detection scheme for an (n. t consecutive columns of H add up to zero. T ⊆ {1. consider any error correction scheme capable of correcting burst errors of length upto t. e2 are burst errors of length upto t. . . Let C be (n. 3. k) block code is a partition of the space Fn2 into 2k subsets Ai . it is necessary for every burst error e of length upto t does not belong to C for the error detection scheme to be able to detect it. we require C ⊆ E c . So it is necessary that v + e ∈ / C for any v ∈ C and any burst error e of length upto t. If a burst error of length upto t results in the received vector which is equal to a codeword then this error will not be detected. . .

It is of the form (x. Derive the generator matrix of C1 ⊕C2 in terms of the generator matrices of C1 and C2 . 0n2 ). . 0n2 ). k2 ) binary linear block code with minimum distance d2 . We claim that the set D = {(a1 . . b2 ). k1 + k2 ) linear block code with minimum distance min(d1 . Here 0ni is a ni -tuple of zeros. Hence C1 ⊕ C2 is a linear code. b1 ). In both cases ax ∈ C1 ⊕ C2 . Then x = (x1 . .P P v ∈ C ⊥ . y1 + y2). Consider any two elements x and y in C1 ⊕ C2 . y2 ) for some x1 . Let A = {a1 . Then x = ki=1 αi ai Pk2 where αi ∈ F2 and y = i=1 βi bi where βi ∈ F2 because the ai ’s form a basis for C1 3 . y1 ∈ C1 and x2 . bk2 } is a basis for C1 ⊕ C2 . This implies that the vector x obtained by puncturing v on T is perpendicular to all the codewords in C T . Show that C1 ⊕ C2 is a (n1 + n2 . (a2 . c2 )kc1 ∈ C1 . . For any a ∈ F2 and x ∈ C1 ⊕ C2 . . Thus C1 ⊕ C2 satisfies the two conditions required for a nonempty subset to be subspace. k1 ) binary linear block code with minimum distance d1 and let C2 be a (n2 . 0n2 ) where the former happens when a = 1 and the latter happens when a = 0. First we check that this set spans C1 ⊕ C2 . 4. Now x is perpendicular to all the codewords w in C obtained by extending each v ∈ C T (because u and v are perpendicular on T and x. . . y2 ∈ C2 . Consider anyPelement 1 in C1 ⊕ C2 . Since each set is the subset of the other they have to be equal. 0n2 ). y) where x ∈ C1 and y ∈ C2 . (b) (C ⊥ )T = (CT )⊥ Solution: Similar argument as in (a). (0n1 . To show that it is a linear code of dimension k1 + k2 . . (0n1 . bk2 } be a basis for C2 . 0n1 ∈ C1 and bi . ax = x or ax = (0n1 . Solution: By definition. Let C1 be a (n1 . To show that the dimension of C1 ⊕C2 is k1 +k2. Their sum x + y is equal to (x1 + x2 . . . . We can extend the vector u to another vector x of length n such that x has zeros in the coordinates in T and is equal to u in the other coordinates. c2 ∈ C2 }. ak1 } be a basis for C1 and let B = {b1 . x2 ) and y = (y1. . Each v is obtained by puncturing a codeword w in C on the coordinates in T . . . Derive the parity check matrix of C1 ⊕ C2 in terms of the parity check matrices of C1 and C2 . 0n2 ∈ C2 . Each element in this set is in C1 ⊕ C2 because ai . (ak1 . Since x has zeros on T and u can be obtained by puncturing x on T we conclude that u ∈ (C ⊥ )T . But u = x as it is the vector obtained by puncturing v on T . (0n1 . a2 . We have shown that (C T )⊥ ⊆ (C ⊥ )T . C1 ⊕ C2 is a nonempty subset of Fn2 1 +n2 . d2 ). Let u ∈ (C T )⊥ . Thus x ∈ C ⊥ . Then u is perpendicular to all the codewords v ∈ C T . b2 . consider bases for C1 and C2 . we have to first show that it is a subspace of Fn2 1 +n2 over F2 . This sum belongs to C1 ⊕ C2 because x1 + x2 ∈ C1 and y1 + y2 ∈ C2 (as C1 and C2 are linear codes). The direct sum of C1 and C2 is defined as C1 ⊕ C2 = {(c1 . we have ni=1 vi wi = 0 for all w ∈ C which implies i∈T c vi wi = 0 (as vi = 0 for i ∈ T ).w are extended versions of them with x being zero in the new coordinates). . Thus u ∈ (C T )⊥ and we have shown that (C ⊥ )T ⊆ (C T )⊥ . .

d2 = wH (y). d1 = wH (x). Since they also span C1 ⊕ C2 . its minimum distance is equal to the minimum weight of its nonzero codewords. (x. 0n2 ) = i=1 and (0n1 . Thus it is given by   G1 0k1 ×n2 G= 0k2 ×n1 G2 If H1 is the parity check matrix of C1 and H2 is the parity check matrix of C2 . Consider a linear combination of the vectors in D which is equal to zero. the dimension of C1 ⊕ C2 is k1 + k2 . Since 4 . 0n2 ) ∈ C1 and (0n1 . We can write (x. j=1 Thus D spans C1 ⊕ C2 . 0n2 ) k2 X βi (0n1 . Let y be a nonzero codeword of minimum weight in C2 i. Thus the elements of D are linearly independent.and the bi ’s form a basis for C2 . bj ). then it has the ai ’s in the set A as its rows and if G2 is the generator matrix of C2 then it has the bi ’s in the set B as its rows. 0n2 ) ⇒ j=1 k1 X αi ai = 0n1 and i=1 k2 X βj bj = 0n2 j=1 Since the elements of A and B form a basis of C1 and C2 respectively. The basis D also gives us the structure of the generator matrix of C1 ⊕ C2 . they are linearly independent and the above equation gives us αi = 0 and βi = 0. k1 X i=1 αi (ai . Now we need to show that the elements of D are linearly independent. Then (x. Since C1 ⊕ C2 is a linear code. If G1 is the generator matrix of C1 . 0n2 ) as k1 X αi (ai . bi ). The generator matrix for C1 ⊕ C2 has the elements in the set D as its rows. the parity check matrix of C1 ⊕ C2 is given by   H1 0(n1 −k1 )×n2 H= H2 0(n2 −k2 )×n1 This can be verified by writing v · H T = 0 where v ∈ Fn2 1 +n2 . y) = k1 X αi (ai .e. Let x be a nonzero codeword of minimum weight in C1 i. y) ∈ C2 because 0n1 ∈ C1 and 0n2 ∈ C2 . they form a basis for this space. Since the number of elements in D is k1 + k2 . y) = i=1 Combining these two equations we get (x. bj ) = (0n1 . y) as (0n1 . 0n2 ) + k2 X βj (0n1 .e. 0n2 ) + i=1 k2 X βj (0n1 .

d2 ). we have dmin ≥ min(d1 . the minimum distance dmin of C1 ⊕ C2 satisfies the following inequality dmin ≤ min(d1 . we have wH (z) ≥ min(d1 . Since z was an arbitrary nonzero codeword. The Hamming weight of z is wH (z) = wH (u) + wH (v). Since at least one of u and v is nonzero and wH (u) ≥ d1 when u 6= 0n1 . d2 ). v ∈ C2 and both u and v acannot be zero codewords.wH ((x. 5 . d2 ). Let z be a nonzero codeword in C1 ⊕ C2 . y)) = d2 . Then z = (u. Thus dmin = min(d1 . v) where u ∈ C1 . wH (v) ≥ d2 when v 6= 0n2 . d2 ). 0n2 )) = d1 and wH ((0n1 .

6 0000000 0000001 0000010 0000100 0001000 0010000 0100000 1000000 1000011 1000010 1000001 1000111 1001011 1010011 1100011 0000011 0100101 0100100 0100111 0100001 0101101 0110101 0000101 1100101 0010110 0010111 0010100 0010010 0011110 0000110 0110110 1010110 0001111 0001110 0001101 0001011 0000111 0011111 0101111 1001111 1100110 1100111 1100100 1100010 1101110 1110110 1000110 0100110 1010101 1010100 1010111 1010001 1011101 1000101 1110101 0010101 1001100 1001101 1001110 1001000 1000100 1011100 1101100 0001100 0110011 0110010 0110001 0110111 0111011 0100011 0010011 1110011 0101010 0101011 0101000 0101110 0100010 0111010 0001010 1101010 0011001 0011000 0011011 0011101 0010001 0001001 0111001 1011001 1110000 1110001 1110010 1110100 1111000 1100000 1010000 0110000 1101001 1101000 1101011 1101101 1100001 1111001 1001001 0101001 Table 1: Standard array for the code given in Exercise 1 1011010 1011011 1011000 1011110 1010010 1001010 1111010 0011010 0111100 0111101 0111110 0111000 0110100 0101100 0011100 1111100 1111111 1111110 1111101 1111011 1110111 1101111 1011111 0111111 .

Coset leader 0000000 0000001 0000010 0000100 0001000 0010000 0100000 1000000 Syndrome 000 001 010 100 111 110 101 011 Table 2: Syndrome table for the code given in Exercise 1 7 .

(a) Show that g ∗ (X) also generates an (n. i is a factor of n. (Hint: If v(X) is a code polynomial in C. 3) binary cyclic code generated by g(X) = (X + 1)(X 3 + X + 1) . show that its ith cyclic shift e(i) (X) is also detectable. 3. 2. Draw the Meggitt decoder circuit for the (7. 4. Let g(X) be the generator polynomial of a binary cyclic code of length n. show that the code contains a codeword consisting of all ones. then X n−1 v(X −1 ) is a code polynomial in C ∗ ). (b) Let v(X) be a code polynomial in a cyclic code of length n. Let i be the smallest integer such that v (i) (X) = v(X). Let g ∗ (X) = X n−k g(X −1 ) be the reciprocal polynomial of g(X). (a) For a cyclic code. (a) Show that if g(X) has X + 1 as a factor. 1. (b) If n is odd and X + 1 is not a factor of g(X). k) cyclic code C generated by g(X). Every nontrivial step in a proof should be accompanied by justification. (c) Show that the code has a minimum weight of at least 3 if n is the smallest integer such that g(X) divides X n + 1. the code contains no codewords of odd weight. 2011 Each of the following exercises is worth 5 points.EE 605: Error Correcting Codes Instructor: Saravanan Vijayakumaran Indian Institute of Technology Bombay Autumn 2011 Assignment 3 : 20 points Due date: October 10. k) cyclic code. Consider a binary (n. (b) Let C ∗ be the cyclic code generated by g ∗ (X). Show that if i 6= 0. if an error pattern e(X) is detectable. Show that C and C ∗ have the same weight distribution.

(c) Show that the code has a minimum weight of at least 3 if n is the smallest integer such that g(X) divides X n + 1. We have g(X) 6= 1 because otherwise g(X) would divide X + 1 which is not equal to X n + 1 for n ≥ 3. So every codeword is of even weight. If a weight one codeword exists. show that the code contains a codeword consisting of all ones. its corresponding code polynomial will be of the form X i for 0 ≤ i ≤ n − 1 which has to be divisible by g(X). . We know that the generator polynomial g(X) divides X n + 1. Solution: Since every code polynomial in a cyclic code is a multiple of the generator polynomial g(X). This implies that c(1) = 0 for a code polynomial c(X) which in turn requires c(X) to have an even number of terms. (b) If n is odd and X + 1 is not a factor of g(X). In the minimum weight calculation of a code. (2) So g(X) divides X n−1 + X n−2 + · · · + X + 1 and hence the all ones codeword is contained in this code. Let g(X) be the generator polynomial of a binary cyclic code of length n. we consider only nonzero codewords. This implies b(X)g(X) = X n−1 + X n−2 + · · · + X + 1. (a) Show that if g(X) has X + 1 as a factor. Solution: The oddness of n is in fact not required for the existence of a codeword consisting of all ones. (1) Since X + 1 appears on the right hand side and is not a factor of g(X). the code contains no codewords of odd weight. it has to be a factor of a(X). every code polynomial has X + 1 as a factor. Let a(X) = (X + 1)b(X). We have a(X)g(X) = X n + 1 = (X + 1)(X n−1 + X n−2 + · · · + X + 1). In fact. Thus X i cannot be a multiple of g(X). Such a factor has zero as a root but zero is not a root of g(X) because it has a nonzero constant term. The generator polynomial of a cyclic code has a nonzero constant term. Solution: For this question to be well defined n has to be at least 3. So it is enough to show that weight one and weight two codewords do not exist. So g(X) has at least two terms which implies that any polynomial multiple of g(X) has at least two terms. X i and g(X) have no factors in common because if they do the common factor will have to be of the form X j for 1 ≤ j ≤ i.EE 605: Error Correcting Codes Instructor: Saravanan Vijayakumaran Indian Institute of Technology Bombay Autumn 2011 Solution to Assignment 3 1.

e(X) 6= 0 mod g(X). its corresponding code polynomial will be of the form X i + X j for 0 ≤ i < j ≤ n − 1 which has to be divisible by g(X). v (n) (X) = v(X). Let g(X)h(X) = X n + 1 where the degree of h(X) is k. k) cyclic code.If a weight two codeword exists. Let g ∗(X) = X n−k g(X −1 ) be the reciprocal polynomial of g(X). we get e(i) (X) mod g(X) = X i e(X) = X i e(X) mod g(X) + a(X)(X n + 1) mod g(X) mod g(X) where the second equality is obtained by the fact that g(X) divides X n + 1. Since g(X) and X j have no factors in common. The ith cyclic shift e(i) (X) is equal to X i e(X) mod X n + 1 where n is the blocklength of the cyclic code. But this is not possible as e(X) mod g(X) is not equal to zero. Solution: If an error pattern e(X) is detectable. n = qi + r. the minimum weight is at least three. we need to prove that g ∗ (X) divides X n +1. (a) Show that g ∗ (X) also generates an (n. Solution: Since any polynomial which divides X n + 1 generates an (n. If i is not a factor of n. Since g(X) and X i have no factors in common (see solution to question 1(c)). If we divide both sides by g(X). Then X i e(X) = a(X)(X n + 1) + e(i) (X) which implies e(i) (X) = X i e(X) + a(X)(X n + 1). 2. Since g(X) generates an (n. g(X) would need to divide e(X). Let i be the smallest integer such that v (i) (X) = v(X). We get g(X −1 )h(X −1 ) = X −n + 1 ⇒ X n g(X −1 )h(X −1 ) = X n (X −n + 1) = 1 + X n ⇒ X n−k g(X −1)X k h(X −1 ) = 1 + X n . divide n by i to get a quotient q and remainder r (0 ≤ r < i). (a) For a cyclic code. show that its ith cyclic shift e(i) (X) is also detectable. we must have r = 0. X i−j + 1 has to be divisible by g(X) but this is not possible since i − j ≤ n − 1. Thus i divides n. (b) Let v(X) be a code polynomial in a cyclic code of length n. So X j (X i−j + 1) has to be divisible by g(X). k) cyclic code. The error pattern e(i) (X) is undetectable if and only if e(i) (X) mod g(X) is equal to zero which happens if and only if X i e(X) mod g(X) is equal to zero. Show that if i 6= 0. i is a factor of n. if an error pattern e(X) is detectable. Solution: Since n cyclic shifts of a codeword of length n returns the codeword to the initial state. k) cyclic code it has degree n − k and it divides X n + 1. 3. Let a(X) be the quotient when X i e(X) is divided by X n + 1. We get v(X) = v (n) (X) = v (qi+r) (X) = v (i+[q−1]i+r)(X) = v ([q−1]i+r) (X) = · · · = v (r) (X) Since i is the smallest integer such that v(X) = v (i) (X) and 0 ≤ r < i. Consider a binary (n. k) cyclic code C generated by g(X). Since no weight one or two codewords exist. 2 .

14 and 16 have a one in the last location i. 4. Once we have constructed the standard array. k) cyclic code. 3) binary cyclic code generated by g(X) = (X + 1)(X 3 + X + 1) Solution: For the Meggitt decoder. We have v(X) X v(X −1 ) X n−1 v(X −1 ) X n−1 v(X −1 ) n−1 = = = = u(X)g(X) X n−1 u(X −1 )g(X −1) X k−1 u(X −1 )X n−k g(X −1) X k−1 u(X −1 )g ∗(X) Since the degree of u(X) is at most k − 1.e. X k−1 u(X −1) is a polynomial. So after we choose all weight one vectors as coset leaders we are free to choose any weight two vector as a coset leader for the ninth coset because it has not appeared so far in the standard array. So the weight distributions of these two codes will have to be the same. First we calculate the eight codewords and find that the minimum weight of the nonzero codewords is four. Show that C and C ∗ have the same weight distribution. When weight two vectors are chosen as coset leaders other weight two vectors can appear in the coset and hence care must be taken to make sure  that they are not chosen as coset leaders for the subsequent 7 cosets. 11. For the last coset. 12. Thus X n−1 v(X −1 ) is a polynomial multiple of g ∗ (X). So if we take weight one coset leaders the cosets will contain vectors of weight at least three. Draw the Meggitt decoder circuit for the (7. For this code n = 7 and k = 3. we see that the coset leaders of cosets 2.Both X n−k g(X −1 ) and X k h(X −1 ) are polynomials in X since g(X) has degree n − k and h(X) has degree k. But we choose those weight two vectors as coset leaders which have a one in the last location so that the Megitt decoder can immediately correct it. The polynomial X n−1 v(X −1 ) has the same number of terms as v(X) albeit in reverse order. we need to identify all correctable error patterns which have a one in the last location. We will show that for every code polynomial in C there is a code polynomial in C ∗ with the same number of terms. From the above expression. (b) Let C ∗ be the cyclic code generated by g ∗(X).e. we see that g ∗(X) = X n−k g(X −1 ) divides X n + 1 and as a consequence it generates an (n. the corresponding polynomial representation has the term X 6 . It is thus a code polynomial in C ∗ . the coset leader has to be of weight three and we choose it to be 0100011 because it has a one in the last location. 10. so there are 2n−k = 24 = 16 correctable error patterns. Solution: Any codeword in C corresponds to a code polynomial v(X) = u(X)g(X) where the degree of u(X) is at most k − 1. There are 2 = 21 weight two vectors of length 7 and they all appear within the first 15 cosets. This will in turn prove that for every codeword in C there is an equal weight codeword in C ∗ . then X n−1 v(X −1 ) is a code polynomial in C ∗ ). So for every code polynomial in C there is a code polynomial in C ∗ . 13. their corresponding 3 . These can be found by constructing the standard array. (Hint: If v(X) is a code polynomial in C. The number of terms in v(X) corresponds to the weight of the corresponding codeword. 9. We could also have chosen 0001101 or 1010001. i.

If the syndrome is represented as the bit string abcd. using Karnaugh map minimization we get the error pattern detection circuit to be equal to bd + (b + c)(a¯ c+a ¯c). The truth table of the error pattern detection circuit is given in the last two columns of the following table. So the error pattern detection circuit of the Megitt decoder should output a one when the syndromes corresponding to these coset leaders appears in the syndrome register. 4 .1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 0000000 0000001 0000010 0000100 0001000 0010000 0100000 1000000 0000011 0000101 0001001 0010001 0100001 1000001 0100010 0100011 1011100 1011101 1011110 1011000 1010100 1001100 1111100 0011100 1011111 1011001 1010101 1001101 1111101 0011101 1111110 1111111 0101110 0101111 0101100 0101010 0100110 0111110 0001110 1101110 0101101 0101011 0100111 0111111 0001111 1101111 0001100 0001101 0010111 0010110 0010101 0010011 0011111 0000111 0110111 1010111 0010100 0010010 0011110 0000110 0110110 1010110 0110101 0110100 1110010 1110011 1110000 1110110 1111010 1100010 1010010 0110010 1110001 1110111 1111011 1100011 1010011 0110011 1010000 1010001 1001011 1001010 1001001 1001111 1000011 1011011 1101011 0001011 1001000 1001110 1000010 1011010 1101010 0001010 1101001 1101000 0111001 0111000 0111011 0111101 0110001 0101001 0011001 1111001 0111010 0111100 0110000 0101000 0011000 1111000 0011011 0011010 1100101 1100100 1100111 1100001 1101101 1110101 1000101 0100101 1100110 1100000 1101100 1110100 1000100 0100100 1000111 1000110 polynomials have a X 6 term.

Coset leader 1 0 2 X6 3 X5 4 X4 5 X3 6 X2 7 X 8 1 9 X6 + X5 10 X6 + X4 11 X6 + X3 12 X6 + X2 13 X6 + X 14 X6 + 1 15 X5 + X 16 X 6 + X 5 + X Syndrome Syndrome (binary) 0 0000 3 2 X +X +X 0111 2 X +X +1 1110 X3 + X2 + 1 1011 3 X 0001 2 X 0010 X 0100 1 1000 X3 + 1 1001 X +1 1100 2 X +X 0110 X3 + X 0101 3 2 X +X 0011 X3 + X2 + X + 1 1111 2 X +1 1010 3 X +X +1 1101 5 0 1 0 0 0 0 0 0 1 1 1 1 1 1 0 1 .

. 1. (Hint: The dual code of an (n. Show n +1 is a code polynomial of weight 2t + 1. α . . Let α be a primitive element of F16 which is a root of p(X). Consider a (2. (c) Is this encoder catastrophic? If yes. Devise a circuit which is capable of multiplying any element in F16 by α7 . . α2t as roots where α is a primitive element of F2m which has order n = 2m − 1. 1) convolutional code with encoder matrix G(D) = 1 + D 2 1 + D + D 2 + D 3 . prove that the minimum distance of the code is exactly2t + 1. 2011 Each of the following exercises is worth 5 points. (a) Draw the encoder circuit. Let F16 be the field generated by p(X) = 1 + X + X 4 .EE 605: Error Correcting Codes Instructor: Saravanan Vijayakumaran Indian Institute of Technology Bombay Autumn 2011 Assignment 4 : 20 points Due date: November 11. k) cyclic code with generator polynomial g(X) has generator n −1 polynomial X k h(X −1 ) where h(X) = Xg(X) . . 2.)   4.) 3. Prove that the dual of a Reed-Solomon code is a Reed-Solomon code. (Hint: Let n = l(2t + 1). Every nontrivial step in a proof should be accompanied by justification. (b) Draw the encoder state diagram. . You can assume the BCH bound in your solution (dmin ≥ 2t + 1). Consider a t-error-correcting binary BCH code of length n = 2m −1. If 2t+1 is a factor of n. Remember that a code polynomial that XX l +1 2 has α. find an infinite weight information sequence which generates a codeword of finite weight.

a1 + a3 and a0 + a2 . . Show n +1 that XX l +1 is a code polynomial of weight 2t + 1. . . prove that the minimum distance of the code is exactly2t + 1. . a2 . α2t as roots where α is a primitive element of F2m which has order n = 2m − 1. (Hint: Let n = l(2t + 1). If we multiply this element by α7 . Solution: Any element in the field F16 can be represented as a0 + a1 α + a2 α2 + a3 α3 . Let F16 be the field generated by p(X) = 1 + X + X 4 . If 2t+1 is a factor of n. • α7 = α3 + α + 1 • α8 = α2 + 1 • α9 = α3 + α • α10 = α2 + α + 1 Using these identities.EE 605: Error Correcting Codes Instructor: Saravanan Vijayakumaran Indian Institute of Technology Bombay Autumn 2011 Solution to Assignment 4 1. You can assume the BCH bound in your solution (dmin ≥ 2t + 1). we will be done if we can show the existence of a codeword whose weight is equal to 2t + 1. The we have the following identities. 2. We have the following identities. a0 + a2 + a3 . a3 and using XOR gates to obtain a0 + a1 + a3 . α . Remember that a code polynomial 2 has α. X l(2t+1) + 1 Y 2t+1 + 1 Xn + 1 = = = 1 + Y + Y 2 + · · · + Y 2t Xl + 1 Xl + 1 Y +1 = 1 + X l + X 2l + · · · + X 2tl So we can see that c(X) = X n +1 X l +1 c(α) = is a polynomial of weight 2t + 1. a1 .) Solution: Since the BCH bound gives us dmin ≥ 2t + 1. l α +1 α +1 . the product can be written as a0 α7 + a1 α8 + a2 α9 + a3 α10 = a0 (α3 + α + 1) + a1 (α2 + 1) + a2 (α3 + α) + a3 (α2 + α + 1) = a0 + a1 + a3 + (a0 + a2 + a3 )α + (a1 + a3 )α2 + (a0 + a2 )α3 The circuit for multiplication by α7 can be now obtained by taking a register containing a0 . we get the element a0 α7 + a1 α8 + a2 α9 + a3 α10 . Let α be a primitive element of F16 which is a root of p(X). Consider a t-error-correcting binary BCH code of length n = 2m −1. Devise a circuit which is capable of multiplying any element in F16 by α7 . We have αn + 1 1+1 = l = 0. Let Y = X l .

k) cyclic code is n−k). (Hint: The dual code of an (n. 1) convolutional code with encoder matrix G(D) = 1 + D 2 1 + D + D 2 + D 3 . i=2t+1 Since αq−1 = 1.   4. Consider a (2. Then the generator polynomial of the dual code is given by k X h(X −1 q−1 Y )= (1 − αi X).) polynomial X k h(X −1 ) where h(X) = Xg(X) Solution: Consider a t-error correcting Reed-Solomon code over a field Fq . (a) Draw the encoder circuit. Here the degree of h(X) is k (remember that the degree of the generator polynomial of an (n. Prove that the dual of a Reed-Solomon code is a Reed-Solomon code. . . Solution: The encoder is catastrophic since the greatest common divisor of the polynomials is 1 + D 2 which is not of the form D l . . (b) Draw the encoder state diagram.Q Then the length of the codewords is n = q −1. αq−2t−1 . k) cyclic code with generator polynomial g(X) has generator n −1 . 2t since 2tl < n. 3. (c) Is this encoder catastrophic? If yes. .. 2 . we get c(αi ) = αni + 1 1+1 = li =0 li α +1 α +1 for i = 2. find an infinite weight information sequence which generates a codeword of finite weight. the generator polynomial of the dual code has roots αq−2t−2 . . Similarly. . αq−1 . . The output corresponding to this input is by 1 + D + D 2 + D 3 + · · · = 1+D   1 v(D) = 1+D G(D) = 1 + D 1 + D 2 . Hence c(X) is a codeword of weight 2t + 1. Thus the dual code is a Reed-Solomon code (see comment in Moodle for the definition of a general RS code). In any field X q−1 − 1 = i=0 consequently we have q−1 q−2 Y Y Xn − 1 X q−1 − 1 i h(X) = (X − αi ) (X − α ) = = = (X − 1) g(X) g(X) i=2t+1 i=2t+1 since αq−1 = 1. It has a generator polynomial Q g(X) = 2t i=1 (X − q−2 (X − αi ) and αi ) where α is a primitive element of Fq . 3. Consider the all ones infinite length information sequence whose polynomial representation is given 1 .The above calculation is valid since the denominator αl + 1 6= 0 due to the fact that l < n = 2m − 1 and α has order 2m − 1 (note that t ≥ 1).

010111. 3. Show that in every binary linear block code either all the codewords have even Hamming weight. Hint: Pn weight or exactly half of the codewords have even Hamming T i=1 vi = 0 for a codeword v of even weight or equivalently v · 1 = 0 where 1 is the 1 × n vector containing all ones. Find the smallest binary linear block code which contains the following codewords {100101. 001011}. Let C1 and C2 be two linear block codes of same length n. What is the minimum distance of this code? 2. Find a systematic generator matrix for this code. Every nontrivial step in a proof should be accompanied by justification. . (b) Show that C1 ∪ C2 is a linear code if and only if either C1 ⊆ C2 or C2 ⊆ C1 . (a) Show that C1 ∩ C2 is a linear code. 110010. 1.EE 605: Error Correcting Codes Instructor: Saravanan Vijayakumaran Indian Institute of Technology Bombay Autumn 2011 Quiz 1 : 15 points Duration: 60 minutes Each of the following questions is worth 5 points.

. Let m be a positive integer. Construct a finite field F8 with 8 elements. . 1. 2. m − 1} is not a group under modulo-m multiplication. You have to write down the addition and multiplication tables for this field. [3 points] 4. where n = |G| > 2.EE 605: Error Correcting Codes Instructor: Saravanan Vijayakumaran Indian Institute of Technology Bombay Autumn 2011 Quiz 2 : 10 points Duration: 60 minutes Every nontrivial step in a proof should be accompanied by justification. [3 points] . [2 points] 3. Prove that a nonzero finite field element β satisfies β m = 1 for some positive integer m if and only if m is divisible by the order of β. [2 points] 2. 3. . Prove that a group G cannot have a subgroup H with |H| = n−1. . If m is not a prime. prove that the set {1.

EE 605: Error Correcting Codes Instructor: Saravanan Vijayakumaran Indian Institute of Technology Bombay Autumn 2011 Quiz 3 : 10 points Duration: 60 minutes 1. If the all zeros codeword was sent. (a) Using the field F16 generated by the primitive polynomial p(X) = X 4 + X 3 + 1. Assume a primitive element α for F16 whose minimal polynomial is p(X) = X 4 + X 3 + 1 (you can use the table above for calculations involving α). determine the generator polynomial of the double error correcting binary BCH code of length 15. [3 points] 2. Determine the generator polynomial of a double error correcting Reed-Solomon code with symbols from F16 . determine a received vector r = r0 r1 · · · rn−1 which results in this error locator polynomial. [3 points] 0 1 α α2 α3 α4 α5 α6 α7 α8 α9 α10 α11 α12 α13 α14 0 1 α α2 α3 α3 + 1 α3 + α + 1 3 α + α2 + α + 1 α2 + α + 1 α3 + α2 + α α2 + 1 α3 + α α3 + α2 + 1 α+1 α2 + α α3 + α2 (b) Suppose for the BCH code described above the error locator polynomial found by the Berlekamp-Massey algorithm is σ(X) = 1 + α10 X + α12 X 2 . The power and remainder representations of the field elements in F16 in terms of a primitive element α are given below. What is the codeword corresponding to the following information bits? [4 points]   u = 0001 0001 0000 0000 · · · 0000 .

u + v)|u ∈ C1 . v ∈ C2 }. 1. 5. 6. Construct the standard array and syndrome decoding table for the (6. Show that C1 ⊆ C2 if and only if g2 (X) divides g1 (X). k2 ) binary linear block code with minimum distance d2 . d2 }. (a) 110110 (b) 110111 (c) 110001 2. Let C1 be an (n. 3) binary linear block code with generator matrix   1 0 0 0 1 1 0 1 0 1 0 1  0 0 1 1 1 0 Decode the following received vectors using the syndrome table generated. Let C1 and C2 be two cyclic codes of same length n with generator polynomials g1 (X) and g2 (X) respectively. Show that C1 ∩ C2 is a cyclic code. Consider a binary linear code with generator  1 1 0 0  G= 0 0 1 1 0 0 0 0 matrix  0 0 0 0 1 1 Suppose N codewords from this code are sent over a binary symmetric channel with crossover probability p. Consider the following set of 2n-tuples C = {(u. Prove that the set C is a binary linear block code with dimension k = k1 + k2 and minimum distance dmin = min{2d1 . What is its generator poynomial? . 4. Let C1 and C2 be two cyclic codes of same length n with generator polynomials g1 (X) and g2 (X) respectively. k1 ) binary linear block code with minimum distance d1 and let C2 be an (n. What is the probability that no undetected errors occur during this transmission? 3. State and prove the Singleton bound for binary block codes.EE 605: Error Correcting Codes Instructor: Saravanan Vijayakumaran Indian Institute of Technology Bombay Autumn 2011 Midsemester Exam : 30 points Duration: 120 minutes Each of the following questions is worth 5 points.