Chapter IV: A Class of Error-Correcting Codes
4. Examples
' t
SP =
L
ei~r+ L
ei~rk=l k=l
' t (12)
sj
=I:
ai~<(eik)2'+I:
ai~<(ejk)zl O~l~m-1k=l k=l
System (12) is a system of m+ 1 equations with 2s+t unknowns, 2s+t ~
m + 1. We are assuming that no error or erasure occurs in track n. If it does, system (12) has to be slightly modified. The unknowns are the errors
Since a B(n,m)-code has minimum distance m+2, a solution to system (12) exists and is unique. So, it is necessary to build circuits that will solve system (12) in order to complete the decoding. The decoder will have
l mt J
+ 1decoding modes, according to the number s
=
01 112, · · ·,l mil J
of trackerrors that B(n, m) can correct. The strategy for choosing a decoding mode is then as follows: count the number t of erasures that have occurred, and then choose the maximum s such that 2s + t ~ m + 1. Assume then that s errors have occurred, and this choice of s will determine the decoding mode.
The examples in the next section will help to clarify this matter.
Example (ii): B(8, 1)
This is the well known Patel-Hong code ([2],[4]). The minimum distance of B(B, 1) is 3, so it can correct either one track-error or two track-erasures.
According to (2) and lemma 3.1., this code is defined by
8
LZj=O
j=O
7 7 (13)
2.:
a1·zj= L cJ
Bj= o
j=O j=O
where a is a root of the irreducible polynomial over GF(2) g(x) = 1
+
x3+
x4
+
x5+
x8• The redundant bits are in B0 and in Z8 (see figure 1). For the encoding, Z8 is readily obtained, while B0= 2:j=
1 ai Bi. The circuits are described in [2]. For the decoding, we have two decoding modes. Let us treat them separately.Mode I: Correction of one track-error
Assume row k is in error, that is, Z~: = Z~:
+
e~; andZi =
Zj for ji=
k.Assume first that k
i=
8. According to (11) and (13), the syndrome isi=O 7 (14)
So=
2".: ciBi
j=O
SP and 80 are calculated immediately from the received bits. According to (12), if 0 ~ k ~ 7
(15)
So, SP gives us the error e1" while ak
=
S0 / SP tells us which track is in error. Adding ek to Zk, we obtain Zk, recovering. the information. If the error occurs in track 8, then S0=
0 and we do not need to bother to recover the information.Mode II: Correction of two erasures
Assume that the information in tracks i and
i
is erased. We have to findzi
and Zj. So, assumezi
= Zj = 0 in order to compute the syndromesp
and S0 • Hence ei
=
Zi and ei = Zi. Let 0::; i< i ::;
8. Ifi
= 8, then(16)
So, ei = a-i S0 and we are not interested in e8 •
If j
<
8, we have(17) Solving this system,
The encoding and decoding circuits are discussed in detail in [2].
Example (iii): B(8, 2)
This code has rate 2/3 and was first reported in [1]. According to (2) and lemma 3.1., the code is defined by
i=O
7 7
2: a' z,
=2: a'
B, = 0 (18)i=O i=O
7 7
L
ai(z,)2= 2:
a2' B;=
oi=O i=O
Now the parity check bits are contained in B0 , B1 and Z8 • Let us describe in detail the encoding and the decoding.
Encoding
Z8 is obtained as in example (ii). B2 , B~, B4 , B5 , B6 and B7 are given, since they contain the information symbols. From (18),
7
Bo
+
aB1=
l:a'Bii=2 7 2 """' 2 °
Bo
+
a B1 = L...., a 'B, i=2 Solving system (19), we obtain7
Bo
= L
ai+1 (ai-2+
a'-3+ ..
0+
1) Bii=2 7
B1 = Z:::ai-1 (a'-1
+
a'- 2+ ·
0 •+
1) B,i=2
Circuits performing (20) are easily constructed.
Decoding
(19t
(20)
Assume rows
Z
0 ,Z
1 , 0 • · ,Z
8 are received (resp., columnsB
0 ,B
1 , 0 • · ,B1 ).
The decoder's first step is to calculate the syndrome
i=O
(21)
i=O
i=O
If no errors occur, we have SP
=
S0=
S1=
0. Since B(8, 2) has minimum distance 4, it can correct either a track-error together with a track-erasure, or three track-erasures. Hence, we need two decoding modes.Mode I: Correction of a track-error and a track-erasure
Assume that an error pattern ei occurs in track i and ei occurs in track j, but j is known, and all the other tracks are correctly transmitted. Assume first that j ~ 7. The decoder has to determine first if i = 8. Notice that, if i
=
8, then S0=
aiei and S1=
aieJ. Thus, a-iso=
SI/S0 =_ei, or (S0 )2 = ai S1 • We see that if i ~ 7, then (S0 )2=I= ai S1 • So, when i = 8, this fact is easily determined and we correct track j after finding ei.
So, assume ai S1 =/= (S0 )2
, then i ~ 7 and the syndrome is given by
s l = eti( ei)2
+ ai (
ei )2 Solving system (22), we obtain(22)
(23) Hence, we have to construct circuits that find S1
+
ai(Sp)2 and (S0 )2+
ai S1 , then we multiply S1
+
ai(Sp)2 by a until we obtain (S0)2+
ai S1 •Counting how many times we had to multiply by a, we obtain i. Once we know i, we are in the case of B(S, 1) with two erasures, i.e., we have to solve system (17).
If
i =
8, since we are not interested in e8 , we have to solvegives us e;.
So= aie; }
i 2
sl
=a (e;)(24)
The decoder's final step is to add e; and ej to the corresponding tracks.
Mode II: Correction of a triple track-erasure
Assume erasure patterns e;, ej and ek occur in tracks i,
i
and k where 0 ~ i< i <
k ~ 8. If k<
8, we have(25)
The solution of this system is given by the following:
2 ai+k(Sp)2 + (So)2 + (ai + ak)Sl (e;) = (ai
+
ai)(ai+
ak)2 ai+k(Sp)2 + (So)2 +(a;+ ak)Sl
(e;) = (ai
+
ai)(ai+
ak) (26)2 ai+i(Sp)2
+
(So)2+
(ai+
ai)S1 (ek)=
(ai+
ak)(ai+
ak)Circuits solving (26) are more complicated than in the case of two era- sures, but still perfectly feasible. In order to find e;, e; and ek, we need
to ta.ke the square root, but this is easily done, since square root is a. 1-1 operation.
Finally, if k
=
8, we ha.ve to solve the system 80 = ai ei+ cr!
ei }sl = ai(ei)2
+
a.i(ej)2 a.nd the solution is given by(27)
(28)
References
[ 1] M. Blaum and R. J. McEliece, "Coding Protection for Magnetic Tapes:
a Generalization of the Patel-Hong Code," to appear.
[2] S. Lin and D. J. Costello, "Error Control Coding," Prentice-Hall, 1983, 16.2.
[3] F. J. MacWilliams and N.J. A. Sloane, "The Theory of Error-Correcting Codes," North Holland, Amsterdam, 1978.
[4] A.M. Patel and S. J. Hong, "Optimal Rectangular Code for High Density Magnetic Tapes," IBM J. Res. Dev., 18, pp.579-588, November f974.
APPENDIX I
ASYMPTOTIC ESTIM:ATES OF INTEGRALS
We want to prove theorem 3.1. of chapter 1. We need some lemmas first.
1. Lemma
Let I1 =
f
000 ~a~c:z~< x1 dx where a~c<
0, M>
0 and t and k are positive integers. Then,!±.!
I= (M(-a~c))- 1c
r (t + 1)
I k k
In particular,
It= 0 (M-!.¥)
Proof: Make the substitution M( -a~c)xlc = u. Then,
X= ( U )1/k -Ma~c
1
looo -u
t+l_lIt= !±.! e u-"k du
k(-Ma~c) 1c o
= (-M~)==1fl r (t: 1)
= 0(M-~)
Proved. 1
2. Lemma
(1)
(2)
80
Let Li~oJ~o Ciiziwi be a double series convergent for 0 :::; z
<
2R, 0 :::;w
<
2S. Then, if 0 :::; z<
R/3, 0 :::; w<
S /3, A is a positive integer,L
Cijz'wi=
0 (z-A+l)+
0 ( urHl)i2:0,j2:0 i+j>A
(3)
Proof: Cij
=
0 ( R-is- i)
since the terms of a convergent series are bounded.Now, if 0 ~ z
<
R/3, 0 ~ w<
R/3, we estimateBut
'"" L- c .. z'vJ-. . 0 ( """ ( z L.., -
)i (w)i)
-;;~o;~~o
'I - i+j>.A. R S-o I: -+-
( 00
( z w
)I)
- I=.A.+l R S
[( z w)A+ll ,
=0 R+ S =O[(z+w)A+lJ
(z+ w)A+l ~ (2max{z,w}t+l = z··Hlmax{z-A+l,w.A.+l}
~ zA+l ( z-A+l
+
W.A.+l) Hence (3) holds. 1Notice that estimate (3) is not uniform with respect to A.
We can now prove theorem 3.1. of chapter I. Let us state it again.
3. Theorem
Let F(M) = ]000 g(x)eA'h(:z:) dx, where g is continuous and positive when x ~ O, h is infinitely differentiable for x ~ 0, h(x)
<
h(O) for all x>
0,h'(o)
=
h"(o) = ... = h(k-ll(o) = o , h(kl(o)<
ofor some k ~ 1, limz-oo h(x) = -oo, ]000 g(x)eh(z) dx converges, and let
h(x)
=
a0+I:
aixij?:_k
for 0 ~ x ~ 8 for some 8
>
0. Then00
g(x) =
I:
bixij=O
F(MJ-
(f. d.u-"t') e'f•l'l
where
and
(4)
(5)
Proof: Assume h(O)
=
a0=
0. Claim: for any T>
0 and l a positive integer,1oo
g(x)~h(z) dx = 0(M-l)
(7) as M---+ oo. In effect, since limz ...oo
= -oo and h is continuous, there exists a constant c>
0 such that h(x)<
-c for all x ~ T. Thus,1oo
g(x)~h(z) dx= 1oo
g(x)e(M-l)h(z)eh(z) dx~ e-c(M-1)
hoo
g(x)eh(z) dx = 0 (e-cM)
= 0 (M-1)
as claimed. Now, consider ~o~cz" as the main factor in the integrand. The remaining factor g(x) exp (Mxk+1(aH1
+
aH2x+
a1:+3x2+ · · ·))
can be ex- panded as a double power series in the two arguments M xH1 and x, conver-gent for 0 ~ x
<
5 and for all values of M xk+1• We denote this double series byP(Mx"+l,x) = LCij (Mxk+1
)i xi
iJ
The coefficients Cij are independent of M and x. We want to approximate P uniformly by its partial sums. Therefore, we restrict M xk+1 to some finite interval. Take for instance 0 ~ M xk+1
<
1. Then, we use the power series only if 0 ~ x ~ M-1/kH. Call r=
M-1/kH. We may assume that M>
5-(Hl), whence T<
5.Choose a positive integer A and write
Then, we have
PA
(Mx"+~,x) = L
cii (Mx"+I)ixi
i~OJ~O i+j$A
hoo
g(x)~h(z) dx-hoo
PA~a~:zk dx=
=
fo'
(P- PA)~a~:zk dx+ /,oo
g(x)~h(z.) dx-ioo
PA~a~:zk dx ==
fo'
(P-PA)t?Ja~:zk
dx+
0 (M-1)+
0(1
00t?Ja~:zk ~
dx) (8) this last step by (7). Notice thatJ,
00 ~a~:zkxA
dx=
0 ( M-1) as M---+ oo by (7), withxA
in place of g(x) and a~cx" in place of h(x). From (3),for x small enough, thus,
for
(P- P.A.)~o~c~k=
0(fooo
M.A.+l~o~c~k x(l:+l)(.A.+l) dx)+
0(fooo ~o~c:zk
z-Hl dx)so, replacing in (8) and using the definition of 11 in lemma 1, by (2), we obtain
~o= g(x)~h(~) dx-
fooo
P.A.~o~c:z~< dx ==
M.A.+to (I(k+t)(.A.+ll)+
0 (I.A.+d+
0 (M-1)=
=
0(M-4-!) +
0 (M-~)+
0 (M-1)=
0(M-¥)
since I is arbitrary. But
looo
p.A.~o~c~" dx =L
Cij ~o=(Mxk+l)izie-'Wo~c:zlc dxO i~Oj~O O
So,
i+JSA
- I:
CjjM Ji(k+l)+ji+j$A.
=
! L
CjjM-i+£+1 ( -ak)-i(I<+Il+J+I f(i(k + 1) +
j+ 1)
k~~ k
Hence, we have
where
If h(O) = a0
f.
O, we simply have an extra factor eMh(o). 1APPENDIX II
HOW GOOD IS THE POISSON APPROXIM:ATION?
In chapter II, we found the MT BF and CG of singly and doubly error- protected computer memories. In particular, the singly error-protected case allowed all kinds of errors to occur. An important assumption when we found the reliability R(t) of a row of chips was, failures in the row are distributed according to a Poisson process. Without this assumption, the formulae would become hopelessly complicated. The question is, how good is this Poisson approximation?
In order to answer this, we are going to find MT BF and CG for both singly and doubly error-protected computer memories in a simplified situa- tion: We assume that all the chip failures are catastrophic. We shall consider the asymptotic case of M rows of chips, where M is a large number. The notation will be the same as the one used in chapter II.
When k failures occur in a row, the Poisson approximation we used in chapter II was
(1)
We consider the two cases separately.
Case (i): Single-error protection
The reliability of a row when 1-ECC is implemented is
Thus,
R(t)
=
e-.\nt+
n(l - e-.\1)e-.\(n~l)t= e-.\nt ( 1
+
n(e.\1- 1))MT BF =
fooo
(R(t))M dtroo
M= lo e-.\nMt ( 1 + n( e.\1 - 1)) dt Making the change of variable >.nt = x, we obtain
where
h(x) =log
(1 +
n(ezfn-1))-
xHence, dividing by (>..Mk)-1,
CG
= ~M roo ~h(zl
dx n loWe need to estimate I =
f
000 eMh(z) dx. We easily verifyh(O) = h'(O) = 0 and h"(O) = - n- 1 n Using (11), chapter II, we have
(2)
(3)
(4)
(5)
{6)
(7)
]
...
1r . / n1r2M ( -h"(O)) =
Y
2(n- 1)M (8) Replacing in (4) and (6), we obtainMTBF-->.n 1
J7;Fill
- -n- 1 -2M (9) andCG-
~v
n{J.i
n
n-1V2
(10)Using the Poisson approximation, Goodman and McEliece found ([3], chapter IT),
(This approximation is also obtained taking a
=
b=
c=
0, d=
1 in (14), chapter II). So, the two values differ by a factorM·
In our typical example~, n
=
39. Henceff,""'
1.01. This means, the Poisson approximation is very good in this case.Case (ii): Doubly error protection
Now the reliability of each row is given by
R(t) =
e-~nt +
n(l-e-~')e-.\(n-l)t +
n(n2- 1)(1- e~~r
e-.\(n-2)t= e-ht (1
+
n(e.\t -1)+
n(n 2-1)(e~t- 1)2)
(11)thus, making the change of variable >.nt = x,