Skip to main content

Decoding RS and BCH Codes (Part 1)

  • Chapter
  • First Online:
Understanding Error Control Coding
  • 598 Accesses

Abstract

The first problem addressed in this chapter is how to find the number of errors when the capability of the code is not exceeded. It is shown that there is a polynomial (the error locator polynomial) whose roots point to the positions of the errors. This polynomial can be computed solving a set of linear equations and its roots are obtained by a method known as the Chien search. The error values are then found solving another set of linear equations. Appendix E presents a fast way to compute the determinants needed. Several examples illustrate how, when the number of errors surpasses the capability of the code, the decoding algorithm may fail, thus allowing the detection of errors. It is also explained how to decode in the presence of errors and erasures. Finally, the Massey algorithm is presented to find the locator polynomial without having to solve a system of linear equations. The proof of the algorithm is in Appendix F.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 129.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Hardcover Book
USD 169.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Appendices

Appendix E: The “Condensation” Method for Evaluating Determinants

When done by hand, the evaluation of determinants is a very laborious task for large orders. For a (15, 3) RS code, for instance, to decide if 6 errors are present, we need to compute the value of a 6 × 6 determinant.

The cofactor expansion method for evaluating a determinant of order 6 involves the computation of 6 determinants of order 5, which in turn requires the evaluation of 5 determinants of order 4 and so on. Therefore, the number of 2 × 2 determinants that must be computed to find the value of a 6 order determinant is 360 (6 × 5 × 4 × 3).

The method for evaluating determinants presented in this appendix reduces this task considerably. For instance, for a 6 × 6 determinant it only involves the computation of 55 determinants of order 2, a mere 15% of the work required by the cofactor expansion.

To get a flavor for the method, I start by presenting two examples.

Example 17

Say we want to compute the following determinant of real numbers

$$ \left|\begin{array}{ccc}5& 3& 2\\ {}6& 4& 1\\ {}2& 2& 3\end{array}\right| $$

Two definitions before we begin: interior of a determinant and consecutive minor .

The interior of a determinant is the array (the matrix) resulting after we eliminate the first and last rows and columns. For a 3 × 3 determinant, its interior is a single number. In the above example, 4. For a 6 × 6 determinant, its interior is a 4 × 4 array and so on.

A consecutive minor is a minor whose rows and columns are adjacent in the original determinant. The minor

$$ \left|\begin{array}{cc}3& 2\\ {}4& 1\end{array}\right| $$

is a consecutive minor, but the minor

$$ \left|\begin{array}{cc}5& 2\\ {}6& 1\end{array}\right| $$

is not.

The method starts by “condensing” the above determinant into a 2 × 2 determinant whose elements are all the consecutive minors of the original determinant, that is: the minors “pivoting” on the elements a11, a12, a21, and a22. In the example,

$$ \left|\begin{array}{cc}\left|\begin{array}{cc}5& 3\\ {}6& 4\end{array}\right|& \left|\begin{array}{cc}3& 2\\ {}4& 1\end{array}\right|\\ {}\left|\begin{array}{cc}6& 4\\ {}2& 2\end{array}\right|& \left|\begin{array}{cc}4& 1\\ {}2& 3\end{array}\right|\end{array}\right|=\left|\begin{array}{cc}2& -5\\ {}4& 10\end{array}\right| $$

After this initial condensation , with the “condensed” determinant

$$ \left|\begin{array}{cc}2& -5\\ {}4& 10\end{array}\right| $$

we do the following two things:

  • Condense it (evaluate it!) into a number, 40.

  • Divide this value by the “interior” (4) of the given determinant.

The result (10) is the value of the original determinant.

Remark

Two remarks are in order. First, the method requires that the interior of the 3 × 3 determinant be different from 0. This is always possible (permuting rows/columns), except for trivial cases of no interest. Second: we had to compute five 2 × 2 determinants, whereas the usual expansion by minors requires only three. Therefore, for determinants of order 3, the method does not offer any advantage. However, the situation reverses for higher orders.

Example 18

The next determinant is a 4 × 4 Vandermonde determinant. We know how to compute its value from Chapter 3.

$$ {\displaystyle \begin{array}{c}\kern0.5em {A}_0 = \left|\begin{array}{cccc}1& 1& 1& 1\\ {}1& 2& 3& 4\\ {}1& 4& 9& 16\\ {}1& 8& 27& 64\end{array}\right|\\ {}=\left(2-1\right)\left(3-1\right)\left(3-2\right)\left(4-1\right)\left(4-2\right)\left(4-3\right)=12\end{array}} $$

Remark

The reason for the negative signs is that we are working with real numbers.

To apply the “condensation” method, we start by “condensing” the above determinant into a determinant of order 3. For that, we compute its 9 “consecutive minors,” from

to

and finally

The result is

$$ {A}_1=\left|\begin{array}{ccc}1& 1& 1\\ {}2& 6& 12\\ {}4& 36& 144\end{array}\right| $$

After this initial condensation step, we proceed with additional condensation/division (C/D) steps.

  • Condense A1 into \( {A}_1^{\prime } \)

    $$ {A}_1^{\prime }=\left|\begin{array}{cc}4& 6\\ {}48& 432\end{array}\right| $$
  • Divide the elements of \( {A}_1^{\prime } \) by the elements of the “interior” of the determinant A0 (highlighted here), which must be different from zero.

We obtain

$$ {A}_2=\left|\begin{array}{cc}2& 2\\ {}12& 48\end{array}\right| $$

Continue now as in Example 17: Condense A2 and divide it by the interior of A1 (that is, 6), which, again, must be different from zero.

The result is \( \raisebox{1ex}{$72$}\!\left/ \!\raisebox{-1ex}{$6$}\right.=12 \), as said before.

Let us recapitulate. The computation consists of an initial condensation (In this example, from 4 × 4 to 3 × 3) followed by two condensation/division pairs . The number if these condensation/division pairs increases with the order of the determinant we want to evaluate. To evaluate a determinant of order n, the number of C/D pairs is n − 2.

Remark

If any of the entries in the interior of A0 are 0, use elementary row/column operations to remove all zeros. Interchanging two rows or columns is enough in many cases.

Two more examples, related to the PGZ decoding of RS codes, follow.

Example 19

To find the locator polynomial of the (15, 3) RS code presented in Section 4.9, we need to compute six determinants of order 5. Say, for instance, we want to calculate L4

$$ {L}_4=\frac{\left|\begin{array}{ccccc}{\alpha}^{11}& {\alpha}^7& {\alpha}^{11}& {\alpha}^{12}& {\alpha}^{13}\\ {}1& {\alpha}^6& {\alpha}^{12}& {\alpha}^{13}& {\alpha}^7\\ {}{\alpha}^{11}& {\alpha}^4& {\alpha}^{13}& {\alpha}^7& {\alpha}^6\\ {}{\alpha}^{12}& {\alpha}^5& {\alpha}^7& {\alpha}^6& {\alpha}^4\\ {}{\alpha}^{13}& 0& {\alpha}^6& {\alpha}^4& {\alpha}^5\end{array}\right|}{\left|\begin{array}{ccccc}{\alpha}^{11}& 1& {\alpha}^{11}& {\alpha}^{12}& {\alpha}^{13}\\ {}1& {\alpha}^{11}& {\alpha}^{12}& {\alpha}^{13}& {\alpha}^7\\ {}{\alpha}^{11}& {\alpha}^{12}& {\alpha}^{13}& {\alpha}^7& {\alpha}^6\\ {}{\alpha}^{12}& {\alpha}^{13}& {\alpha}^7& {\alpha}^6& {\alpha}^4\\ {}{\alpha}^{13}& {\alpha}^7& {\alpha}^6& {\alpha}^4& {\alpha}^5\end{array}\right|} $$

Let’s compute the numerator using the condensation method explained before.

The matrix is the following

$$ {A}_0=\left(\begin{array}{ccccc}{\alpha}^{11}& {\alpha}^7& {\alpha}^{11}& {\alpha}^{12}& {\alpha}^{13}\\ {}1& {\alpha}^6& {\alpha}^{12}& {\alpha}^{13}& {\alpha}^7\\ {}{\alpha}^{11}& {\alpha}^4& {\alpha}^{13}& {\alpha}^7& {\alpha}^6\\ {}{\alpha}^{12}& {\alpha}^5& {\alpha}^7& {\alpha}^6& {\alpha}^4\\ {}{\alpha}^{13}& 0& {\alpha}^6& {\alpha}^4& {\alpha}^5\end{array}\right) $$

The initial condensation produces the 4 × 4 matrix

$$ {A}_1=\left(\begin{array}{cccc}{\alpha}^{12}& {\alpha}^{10}& 0& {\alpha}^{13}\\ {}{\alpha}^{10}& 1& {\alpha}^{13}& {\alpha}^9\\ {}0& {\alpha}^5& {\alpha}^9& 1\\ {}{\alpha}^3& {\alpha}^{11}& 1& {\alpha}^7\end{array}\right) $$

The other matrices are

$$ {\displaystyle \begin{array}{l}{A}_1^{\prime }=\left(\begin{array}{ccc}{\alpha}^{14}& {\alpha}^8& {\alpha}^{11}\\ {}1& \alpha & {\alpha}^8\\ {}{\alpha}^8& 0& {\alpha}^4\end{array}\right)\kern1em {A}_2=\left(\begin{array}{ccc}{\alpha}^8& {\alpha}^{11}& {\alpha}^{13}\\ {}{\alpha}^{11}& {\alpha}^3& \alpha \\ {}{\alpha}^3& 0& {\alpha}^{13}\end{array}\right)\\ {}{A}_2^{\prime }=\left(\begin{array}{cc}{\alpha}^8& {\alpha}^{13}\\ {}{\alpha}^6& \alpha \end{array}\right)\kern1em {A}_3=\left(\begin{array}{cc}{\alpha}^8& 1\\ {}\alpha & {\alpha}^7\end{array}\right)\end{array}} $$

And finally

$$ {A}_3^{\prime }={\alpha}^4\kern1em {A}_4=\alpha $$

Therefore, we conclude that

$$ \mathrm{Det}\left({A}_0\right)=\alpha $$

Remark

Similarly, we can compute the denominator. The result is α6 and therefore \( {L}_4=\frac{\alpha }{\alpha^6}={\alpha}^{10} \) as said in Section 4.9.

Example 20

Before we proceed with the calculation of the locator polynomial, we need to know how many errors are present. The first step is to see if there are six errors. Therefore, we must find the value the determinant of the 6 × 6 matrix

$$ {A}_0=\left(\begin{array}{cccccc}{\alpha}^{11}& 1& {\alpha}^{11}& {\alpha}^{12}& {\alpha}^{13}& {\alpha}^7\\ {}1& {\alpha}^{11}& {\alpha}^{12}& {\alpha}^{13}& {\alpha}^7& {\alpha}^6\\ {}{\alpha}^{11}& {\alpha}^{12}& {\alpha}^{13}& {\alpha}^7& {\alpha}^6& {\alpha}^4\\ {}{\alpha}^{12}& {\alpha}^{13}& {\alpha}^7& {\alpha}^6& {\alpha}^4& {\alpha}^5\\ {}{\alpha}^{13}& {\alpha}^7& {\alpha}^6& {\alpha}^4& {\alpha}^5& 0\\ {}{\alpha}^7& {\alpha}^6& {\alpha}^4& {\alpha}^5& 0& {\alpha}^9\end{array}\right) $$

All the entries in the interior of A0 are nonzero. But, after a quick look at the elements of A0 we notice that, when we condense A0 into A1, the element a22 of A1 is zero. In fact,

$$ {a}_{22}=\left|\begin{array}{cc}{\alpha}^{11}& {\alpha}^{12}\\ {}{\alpha}^{12}& {\alpha}^{13}\end{array}\right| $$

This element belongs to the interior of A1, which makes impossible the computation of A3. Interchanging rows or columns usually solves the problem. For instance, permuting columns 1 and 2, we have the matrix

$$ {A}_0^{\ast }=\left(\begin{array}{cccccc}1& {\alpha}^{11}& {\alpha}^{11}& {\alpha}^{12}& {\alpha}^{13}& {\alpha}^7\\ {}{\alpha}^{11}& 1& {\alpha}^{12}& {\alpha}^{13}& {\alpha}^7& {\alpha}^6\\ {}{\alpha}^{12}& {\alpha}^{11}& {\alpha}^{13}& {\alpha}^7& {\alpha}^6& {\alpha}^4\\ {}{\alpha}^{13}& {\alpha}^{12}& {\alpha}^7& {\alpha}^6& {\alpha}^4& {\alpha}^5\\ {}{\alpha}^7& {\alpha}^{13}& {\alpha}^6& {\alpha}^4& {\alpha}^5& 0\\ {}{\alpha}^6& {\alpha}^7& {\alpha}^4& {\alpha}^5& 0& {\alpha}^9\end{array}\right) $$

We can now proceed with the computation of A1 and the other matrices.

$$ {A}_1=\left(\begin{array}{ccccc}{\alpha}^9& {\alpha}^7& 0& {\alpha}^{13}& {\alpha}^9\\ {}{\alpha}^2& {\alpha}^3& {\alpha}^{13}& {\alpha}^9& 1\\ {}0& {\alpha}^{12}& {\alpha}^9& 1& {\alpha}^7\\ {}{\alpha}^{13}& {\alpha}^{11}& 1& {\alpha}^7& {\alpha}^{10}\\ {}{\alpha}^9& {\alpha}^{14}& {\alpha}^7& {\alpha}^{10}& {\alpha}^{14}\end{array}\right) $$
$$ {\displaystyle \begin{array}{ll}{A}_1^{\prime }=\left(\begin{array}{cccc}{\alpha}^8& {\alpha}^5& {\alpha}^{11}& {\alpha}^8\\ {}{\alpha}^{14}& {\alpha}^3& {\alpha}^8& {\alpha}^4\\ {}{\alpha}^{10}& {\alpha}^{14}& {\alpha}^4& {\alpha}^{11}\\ {}{\alpha}^{14}& 1& {\alpha}^{11}& {\alpha}^9\end{array}\right)& {A}_2=\left(\begin{array}{cccc}{\alpha}^8& {\alpha}^8& {\alpha}^{13}& \alpha \\ {}{\alpha}^3& {\alpha}^5& \alpha & {\alpha}^{13}\\ {}{\alpha}^{13}& {\alpha}^7& {\alpha}^{13}& {\alpha}^7\\ {}\alpha & {\alpha}^9& {\alpha}^7& {\alpha}^4\end{array}\right)\\ {}{A}_2^{\prime }=\left(\begin{array}{ccc}{\alpha}^4& \alpha & {\alpha}^9\\ {}{\alpha}^{12}& {\alpha}^{13}& {\alpha}^7\\ {}{\alpha}^{11}& \alpha & {\alpha}^{13}\end{array}\right)& {A}_3=\left(\begin{array}{ccc}\alpha & {\alpha}^3& 1\\ {}1& {\alpha}^4& {\alpha}^7\\ {}1& \alpha & {\alpha}^6\end{array}\right)\\ {}{A}_3^{\prime }=\left(\begin{array}{cc}{\alpha}^{11}& {\alpha}^2\\ {}1& \alpha \end{array}\right)& {A}_4=\left(\begin{array}{cc}{\alpha}^6& \alpha \\ {}{\alpha}^8& {\alpha}^3\end{array}\right)\\ {}{A}_4^{\prime }=0& {A}_5=0\end{array}} $$

This implies that the number of errors present is not 6.

The computational effort required by the condensation method, when it can be made to work, compares very favorably to the usual cofactor expansion. The nice feature of Massey algorithm is that it completely avoids the evaluation of determinants, and that it always works. In this same line of reducing computational complexity, I present in Chapter 5 a method, due to Forney, to find the error values without having to solve a system of linear equations, in sharp contrast to the methods I used in Sections 4.6 and 4.10.

Appendix F: The Massey Algorithm

The Massey algorithm iteratively solves the problem of finding the shortest shift register that produces a prescribed sequence of symbols . Therefore, it can be applied to finding the error locator polynomial or to problems in other areas, for instance cryptography.

A shift register is defined giving its length, L, and its connection polynomial, L(D). Since the length may not be equal to the degree of L(D), both L(D) and L ≥ g are needed to specify the circuit.

Equivalently, the register is also described appending L − g leading zeros to L(D), that is writing

$$ L(D)=1+{c}_1D+{c}_2{D}^2+\cdots +{c}_g{D}^g+0{D}^{g+1}+\cdots +0{D}^L $$

instead of

$$ L(D)=1+{c}_1D+\cdots +{c}_g{D}^g $$

It is a trivial task to find a register that produces the sequence s0, s1, … , sN, namely: L = N + 1 and any L(D) (In fact, we don’t care about the symbols the register generates, and therefore about the polynomial. They are irrelevant, since all the symbols we want to match are already loaded in the register!). However, to find a minimum length register requires a little work and much insight.

As stated, Massey algorithm works iteratively. So, say we have found some register (Ln(D), Ln) (not necessarily minimum length) that produces the first n terms of s0, s1, … , sN but not sn. Let’s call \( {s}_n^{\prime}\ne {s}_n \) the symbol output by the register. Keeping up with the idea of employing prior computations, to find a register (Ln + 1(D),  Ln + 1) that also generates sn (and perhaps more terms, although this is not required), we’ll use Ln(D) adding to it a correction term constructed utilizing the connection polynomial Lm(D) of a previously obtained register (Lm(D), Lm) with which we produced s0, s1, …, sm − 1 but not sm. Again, call \( {s}_m^{\prime } \) the register output.

The discrepancies are (remember: subtraction is the same as addition)

$$ {d}_m={s}_m+{s}_m^{\prime}\ne 0,\kern1em {d}_n={s}_n+{s}_n^{\prime}\ne 0 $$

Then, the following correcting term does the job

$$ \frac{d_n}{d_m}{D}^{n-m}{L}_m(D) $$

Thus

$$ {L}_{n+1}(D)={L}_n(D)+\frac{d_n}{d_m}{D}^{n-m}{L}_m(D) $$

I show below that the register with the connection polynomial given above generates s0, s1, … , sn − 1, sn. It may even produce n ≥ n + 1 symbols. However, we don’t care about that.

To avoid unnecessary complications, I’ll justify the above formula using an example. Say that (L8(D), L8) and (L5(D), L5) produce only the first 8 and 5 symbols with 5 cells and 3 cells, respectively (see Fig. 4.21). I underlined “only” to emphasize that symbol \( {s}_8^{\prime } \), output by (L8(D), L8), differs from s8, and the same happens with s5 and \( {s}_5^{\prime } \), the symbol generated by (L5(D), L5).

Fig. 4.21
figure 21

The register (L8(D), L8), and (L5(D), L5)

A full description of the circuits is provided by the polynomials L8(D) and L5(D)

$$ {L}_8(D)=1+\sum \limits_1^5{c}_i{D}^i\kern1em {L}_5(D)=1+\sum \limits_1^3{c}_i^{\prime }{D}^i $$

Recall that c5 and \( {c}_3^{\prime } \) (and other coefficients, as well) may be zero.

After being initially loaded with s0, s1, s2, s3, s4, the first four symbols generated by (L8(D), L8) are

$$ {\displaystyle \begin{array}{l}{s}_5={s}_4{c}_1+{s}_3{c}_2+{s}_2{c}_3+{s}_1{c}_4+{s}_0{c}_5\\ {}{s}_6={s}_5{c}_1+{s}_4{c}_2+{s}_3{c}_3+{s}_2{c}_4+{s}_1{c}_5\\ {}{s}_7={s}_6{c}_1+{s}_5{c}_2+{s}_4{c}_3+{s}_3{c}_4+{s}_2{c}_5\\ {}{s}_8^{\prime }={s}_7{c}_1+{s}_6{c}_2+{s}_5{c}_3+{s}_4{c}_4+{s}_3{c}_5\ne {s}_8\end{array}} $$

Similarly, with register (L5(D), L5) we generate

$$ {\displaystyle \begin{array}{l}{s}_3={s}_2{c}_1^{\prime }+{s}_1{c}_2^{\prime }+{s}_0{c}_3^{\prime}\\ {}{s}_4={s}_3{c}_1^{\prime }+{s}_2{c}_2^{\prime }+{s}_1{c}_3^{\prime}\\ {}{s}_5^{\prime }={s}_4{c}_1^{\prime }+{s}_3{c}_2^{\prime }+{s}_2{c}_3^{\prime}\ne {s}_5\end{array}} $$

after initially loading it with s0, s1, s2.

The connection polynomial for the circuit that (as we shall see) also produces (at least) s8 is:

$$ {\displaystyle \begin{array}{c}\ {L}_9(D)={L}_8(D)+\frac{d_8}{d_5}{D}^{8-5}{L}_5(D)\\ {}=\left(1+\sum \limits_1^5{c}_i{D}^i\right)+\frac{d_8}{d_5}{D}^3\left(1+\sum \limits_1^3{c}_i^{\prime }{D}^i\right)\\ {}=1+{c}_1D+{c}_2{D}^2+\left({c}_3+\frac{d_8}{d_5}\right){D}^3\\ {}\kern0.5em +\left({c}_4+\frac{d_8}{d_5}\ {c}_1^{\prime}\right){D}^4+\left({c}_5+\frac{d_8}{d_5}{c}_2^{\prime}\right){D}^5+\frac{d_8}{d_5}{c}_3^{\prime }{D}^6\end{array}} $$

The circuit is represented in Fig. 4.22. Its length is 6, but its grade may be less than 6 (if \( {c}_3^{\prime }=0 \)).

Fig. 4.22
figure 22

The register (L9(D), L9)

To prove that the circuit generates s8 also (at least!), we’ll begin by looking at the equivalent circuit in Fig. 4.23. If the upper connections were not present, the lower connections would clearly produce the same symbols as (L8(D), L8), although with a longer register. Therefore, the lower part of the circuit can be called the generating part of the register.

Fig. 4.23
figure 23

The register (L9(D), L9) generates S6

Remark

From Fig. 4.23, it is apparent that, in general, the length of the circuit is

$$ \max \left\{{L}_n,n-m+{L}_m\right\} $$

In the example

$$ \max \left\{5,8-5+3\right\}=6 $$

Since the symbols produced by the upper and lower connections are added, let’s see what effect have the symbols that come from the upper connections.

From Fig. 4.23, the first symbol generated by the upper connections is

$$ {s}_3+{s}_2{c}_1^{\prime }+{s}_1{c}_2^{\prime }+{s}_0{c}_3^{\prime } $$

But

$$ {s}_3={s}_2{c}_1^{\prime }+{s}_2{c}_1^{\prime }+{s}_2{c}_1^{\prime } $$

Therefore, the contribution is 0, and s6 enters the register unchanged (as if the upper connections wouldn’t exist). The same happens with s7 (see Fig. 4.24). Finally, from Fig. 4.25 we see that the third contribution from the upper part of the circuit is

$$ \frac{d_8}{d_5}\left({s}_5+{s}_4{c}_1^{\prime }+{s}_3{c}_2^{\prime }+{s}_2{c}_3^{\prime}\right)=\frac{d_8}{d_5}\left({s}_5+{s}_5^{\prime}\right)=\frac{d_8}{d_5}{d}_5={d}_8 $$
Fig. 4.24
figure 24

The register (L9(D), L9) generates S7

Fig. 4.25
figure 25

The register (L9(D), L9) generates S8

This is exactly what we need to correct the output provided by the lower part of the circuit. Thus, the upper part of the shift register can be called the correcting part of the circuit, in agreement with the name (correcting term) given to the second term of L9(D).

Let us recapitulate.

The construction just presented to synthesize a (Ln + 1(D), Ln + 1) register capable of producing (at least) the first n + 1 terms of a given sequence works with any pair (Ln(D), Ln), (Lm(D), Lm) that only output the first n and m(m < n) symbols, respectively. The feedback polynomial is

$$ {L}_{n+1}(D)={L}_n(D)+\frac{d_n}{d_m}{D}^{n-m}{L}_m(D) $$

with

$$ {L}_n(D)=1+\sum \limits_1^{L_n}{c}_i{D}^i\kern1em {L}_m(D)=1+\sum \limits_1^{L_m}{c}_i{D}^i $$

and the register length

$$ {L}_{n+1}=\max \left\{{L}_n,n-m+{L}_m\right\} $$

Suppose that the lengths of (Ln(D), Ln)  and (Lm(D), Lm) are the shortest possible? Call these minimum lengths \( {\widehat{L}}_n \) and \( {\widehat{L}}_m \).

Now, two questions

  • Is there anything we can say about \( {\widehat{L}}_n \) and \( {\widehat{L}}_m \).

  • If we have several choices for \( \left({\widehat{L}}_m(D),{\widehat{L}}_m\right) \), is there a choice that guarantees that (Ln + 1(D), Ln + 1) is also a shortest length register?

We’ll proceed in three steps.

First Step

The first step towards answering the questions above is to prove a lower bound on Ln+1, namely:

$$ {L}_{n+1}\ge n+1-{L}_n $$

To show that, let’s consider the following problem: We have the two registers, Reg1, of length 2, and Reg2, of length 5, both represented in Fig. 4.26. Reg1 is initially loaded with s0 and s1. The output the sequence is

$$ {s}_0\kern0.75em {s}_1\ \kern0.5em {s}_2\ \kern0.5em {s}_3\ \kern0.5em {s}_4\ \kern0.5em {s}_5\ \kern0.5em {s}_6\ \kern0.5em {s}_7\ \kern0.5em {s}_8\ \kern0.5em {s}_9\ \kern0.5em {s}_{10}\ \kern0.5em {s}_{11}\dots $$

where

$$ {s}_2={s}_1{c}_1+{s}_0{c}_2 $$
(4.29)
$$ {s}_3={s}_2{c}_1+{s}_1{c}_2 $$
(4.30)
$$ {s}_4={s}_3{c}_1+{s}_2{c}_2 $$
(4.31)
$$ {s}_5={s}_4{c}_1+{s}_3{c}_2 $$
(4.32)
$$ {s}_6={s}_5{c}_1+{s}_4{c}_2 $$
(4.33)
$$ {s}_7={s}_6{c}_1+{s}_5{c}_2 $$
(4.34)

and so on.

Fig. 4.26
figure 26

Matching registers

Reg2 is initialized with the first 5 symbols output by Reg1. How many of the symbols produced by Reg1 can be matched by Reg2? Clearly, at least 5, but perhaps more symbols depending on the connections.

Let’s write the equations required by the matching

$$ {s}_4{c}_1^{\prime }+{s}_3{c}_2^{\prime }+{s}_2{c}_3^{\prime }+{s}_1{c}_4^{\prime }+{s}_0{c}_5^{\prime }={s}_5 $$
(4.1′)
$$ \kern0.5em {s}_5{c}_1^{\prime }+{s}_4{c}_2^{\prime }+{s}_3{c}_3^{\prime }+{s}_2{c}_4^{\prime }+{s}_1{c}_5^{\prime }={s}_6 $$
(4.2′)
$$ {s}_6{c}_1^{\prime }+{s}_5{c}_2^{\prime }+{s}_4{c}_3^{\prime }+{s}_3{c}_4^{\prime }+{s}_2{c}_5^{\prime }={s}_7 $$
(4.3′)
$$ {s}_7{c}_1^{\prime }+{s}_6{c}_2^{\prime }+{s}_4{c}_3^{\prime }+{s}_4{c}_4^{\prime }+{s}_3{c}_5^{\prime }={s}_8 $$
(4.4′)
$$ {s}_8{c}_1^{\prime }+{s}_7{c}_2^{\prime }+{s}_6{c}_3^{\prime }+{s}_5{c}_4^{\prime }+{s}_4{c}_5^{\prime }={s}_9 $$
(4.5′)
$$ {s}_9{c}_1^{\prime }+{s}_8{c}_2^{\prime }+{s}_7{c}_3^{\prime }+{s}_6{c}_4^{\prime }+{s}_5{c}_5^{\prime }={s}_{10} $$
(4.6′)
$$ {s}_{10}{c}_1^{\prime }+{s}_9{c}_2^{\prime }+{s}_8{c}_3^{\prime }+{s}_7{c}_4^{\prime }+{s}_6{c}_5^{\prime }={s}_{11} $$
(4.7′)

and so on.

Observe that Eq. (4.3′) is a linear combination of Eqs. (4.1′) and (4.2′). In fact, we have

$$ \left({4.3}^{\prime}\right)={c}_1\left({4.2}^{\prime}\right)+{c}_2\left({4.1}^{\prime}\right) $$

as can be seen from the Eqs. (4.29)–(4.34). Similarly, we have:

$$ {\displaystyle \begin{array}{l}\left({4.4}^{\prime}\right)={c}_1\left({4.3}^{\prime}\right)+{c}_2\left({4.2}^{\prime}\right)\\ {}\left({4.5}^{\prime}\right)={c}_1\left({4.4}^{\prime}\right)+{c}_2\left({4.3}^{\prime}\right)\\ {}\left({4.6}^{\prime}\right)={c}_1\left({4.5}^{\prime}\right)+{c}_2\left({4.4}^{\prime}\right)\\ {}\left({4.7}^{\prime}\right)={c}_1\left({4.6}^{\prime}\right)+{c}_2\left({4.5}^{\prime}\right)\end{array}} $$

and so on.

This means that, not only Eq. (4.3′), but also Eqs. (4.4′)–(4.7′)… are linear combinations of Eqs. (4.1′) and (4.2′). Therefore, if Eqs. (4.1′) and (4.2′) are satisfied, all the other equations are satisfied. In other words, if the coefficients of Reg2 are chosen to output s5 and s6, then Reg2 produces not only the first 7(=5 + 2) symbols output by Reg1, but all of them.

Expressing this more generally, we can say that whenever the outputs of two registers of length L1 and L2 coincide in the first L1 + L2 symbols, they always coincide.

This is the key result needed to prove the lower bound on Ln + 1. But before we do that, here is a numerical example to illustrate the preceding argument.

Example 21

Refer to Fig. 4.24. Reg1 is loaded with s0 = 1 and s1 = α. The connection polynomial is

$$ L(D)=1+{\alpha}^3D+{\alpha}^7{D}^2 $$

The register output is

$$ 1\kern0.75em \alpha\ \kern0.5em {\alpha}^3\ \kern0.5em {\alpha}^{14}\ \kern0.5em {\alpha}^4\ \kern0.5em {\alpha}^{10}\ \kern0.5em {\alpha}^4\ \kern0.5em {\alpha}^{12}\ \kern0.5em {\alpha}^{12}\ \kern0.5em \alpha\ \kern0.5em 0\ \kern0.5em {\alpha}^8\dots \dots $$

Reg2 is loaded with

$$ {s}_0=1,\kern1em {s}_1=\alpha, \kern1em {s}_2={\alpha}^3,\kern1em {s}_3={\alpha}^{14},\kern1em {s}_4={\alpha}^4 $$

Equations (4.1′) and (4.2′) are

$$ {\displaystyle \begin{array}{l}{\alpha}^4{c}_1^{\prime }+{\alpha}^{14}{c}_2^{\prime }+{\alpha}^3{c}_3^{\prime }+\alpha {c}_4^{\prime }+{c}_5^{\prime }={\alpha}^{10}\\ {}{\alpha}^{10}{c}_1^{\prime }+{\alpha}^4{c}_2^{\prime }+{\alpha}^{14}{c}_3^{\prime }+{\alpha}^3{c}_4^{\prime }+\alpha {c}_5^{\prime }={\alpha}^4\end{array}} $$

The values of \( {c}_4^{\prime } \) and \( {c}_5^{\prime } \) can be determined as functions of \( {c}_1^{\prime },{c}_2^{\prime },{c}_3^{\prime } \).

We obtain

$$ {\displaystyle \begin{array}{l}{c}_4^{\prime }={\alpha}^7+{\alpha}^9{c}_1^{\prime }+{\alpha}^{10}{c}_2^{\prime }+{\alpha}^3{c}_3^{\prime}\\ {}{c}_5^{\prime }=\alpha +{\alpha}^2{c}_1^{\prime }+{\alpha}^{10}{c}_2^{\prime }+{\alpha}^7{c}_3^{\prime}\end{array}} $$

There are multiple solutions. If, for instance, we set

$$ {c}_1^{\prime }={c}_2^{\prime }={c}_3^{\prime }=0 $$

we have

$$ {c}_4^{\prime }={\alpha}^7,\kern1em {c}_5^{\prime }=\alpha $$

The symbols output by Reg2 are

$$ 1\kern0.75em \alpha\ \kern0.5em {\alpha}^3\ \kern0.5em {\alpha}^{14}\ \kern0.5em {\alpha}^4\ \kern0.5em {\alpha}^{10}\ \kern0.5em {\alpha}^4\ \kern0.5em {\alpha}^{12}\ \kern0.5em {\alpha}^{12}\ \kern0.5em \alpha\ \kern0.5em 0\ \kern0.5em {\alpha}^8\dots \kern0.5em \dots $$

This agrees with the symbols produced by Reg1.

Let’s proceed now to prove the lower bound on Ln + 1.

Assume the contrary, that is

$$ {L}_{n+1}<n+1-{L}_n $$

Then

$$ {L}_{n+1}+{L}_n\le n $$

Since the outputs of registers (Ln(D), Ln) and (Ln + 1(D), Ln + 1) coincide in n symbols, and n is greater than or equal to the sum of the two lengths, their outputs must always coincide, which contradicts that (Ln + 1(D), Ln + 1) generates sn and (Ln(D), Ln) does not.

Second Step

This bound is valid in general and, therefore, also when (Ln(D), Ln) is a shortest length register. Thus

$$ {L}_{n+1}\ge n+1-{\widehat{L}}_n $$

Clearly, the above equation implies

$$ {\widehat{L}}_{n+1}\ge n+1-{\widehat{L}}_n $$

On the other hand

$$ {L}_{n+1}\ge {\widehat{L}}_n $$

(\( {L}_{n+1}<{\widehat{L}}_n \) contradicts that \( \left({\widehat{L}}_n(D),{\widehat{L}}_n\right) \) is a minimum length register that produces n symbols)

Consequently

$$ {\widehat{L}}_{n+1}\ge {\widehat{L}}_n $$

So, we can write

$$ {\widehat{L}}_{n+1}\ge \max \left({\widehat{L}}_n,n+1-{\widehat{L}}_n\right) $$
(4.35)

Third Step

To continue, say we have iteratively constructed a sequence of registers that satisfy (4.35) with equality, that is: registers of the minimum possible length. Then, I shall prove that Ln + 1 also does if \( \left({\widehat{\boldsymbol{L}}}_{\boldsymbol{m}}\left(\boldsymbol{D}\right),{\widehat{\boldsymbol{L}}}_{\boldsymbol{m}}\right) \) is chosen properly.

The polynomial Ln + 1(D) is constructed using \( {\widehat{L}}_n(D) \) and \( {\widehat{L}}_m(D) \)

$$ {L}_{n+1}(D)={\widehat{L}}_n(D)+\frac{d_n}{d_m}{D}^{n-m}{\widehat{L}}_m(D) $$
(4.36)

As said before, the length of the circuit is

$$ {L}_{n+1}=\max \left\{{\widehat{L}}_n,n-m+{\widehat{L}}_m\right\} $$

If we could find a register such that

$$ {\widehat{L}}_m=m+1-{\widehat{L}}_n $$

we would have

$$ {\displaystyle \begin{array}{c}{L}_{n+1}=\max \left\{{\widehat{L}}_n,n-m+{\widehat{L}}_m\right\}\\ {}=\max \left\{{\widehat{L}}_n,n-m+m+1-{\widehat{L}}_n\right\}\\ {}=\max \left\{{\widehat{L}}_n,n+1-{\widehat{L}}_n\right\}\end{array}} $$

That is, a register of minimum length!

Choose as \( \left({\widehat{L}}_m(D),{\widehat{L}}_m\right) \) the register just prior to the whole bunch of registers of length \( {\widehat{L}}_n \). That is, the register that generates more symbols than any other register of length less than \( {\widehat{L}}_n \) (see Fig. 4.27).

Fig. 4.27
figure 27

A sequence of registers of minimum length

Remark

Recall that the register \( \left({\widehat{L}}_m(D),{\widehat{L}}_m\right) \) produces s0 s1 … sm − 1 but not sm. Similarly, (\( {\widehat{L}}_{m^{\prime }}(D),{\widehat{L}}_{m^{\prime }} \)) outputs \( {s}_0{s}_1\dots {s}_{m-1}{s}_m\dots {s}_{m^{\prime }-1} \). That is: at least up to sm, but perhaps more. Therefore, m ≥ m + 1 and \( {d}_{m^{\prime }} \) are both known. Hence, it is more appropriate to write (\( {\widehat{L}}_{m^{\prime }}(D),\kern0.5em {\widehat{L}}_{m^{\prime }} \)) than (\( {\widehat{L}}_{m+1}(D),{\widehat{L}}_{m+1} \)).

We, then, have

$$ {\widehat{L}}_m<{\widehat{L}}_n\kern1em \mathrm{and}\kern1em {\widehat{L}}_{m^{\prime }}={\widehat{L}}_n\kern0.75em \left({m}^{\prime}\ge m+1\right) $$

Now, since (\( {\widehat{L}}_{m^{\prime }}(D),{\widehat{L}}_{m^{\prime }} \)) is minimum length and generates sm, we can write

$$ {\widehat{L}}_{m^{\prime }}=\max \left({\widehat{L}}_m,m+1-{\widehat{L}}_m\right) $$

Therefore

$$ {\widehat{L}}_n={\widehat{L}}_{m^{\prime }}=\max \left({\widehat{L}}_m,m+1-{\widehat{L}}_m\right)=m+1-{\widehat{L}}_m $$

(The last equality holds because \( {\widehat{L}}_n>{\widehat{L}}_m \)).

Hence

$$ {\widehat{L}}_m=m+1-{\widehat{L}}_n $$

as desired.

Summarizing:

As we did in the examples of this chapter, we start the algorithm with two minimum length registers of different lengths, say L and L with L < L, such that the register of length L generates more symbols than any other register of length less than L. Then, the algorithm guaranties that the registers will be minimum length at every step.

Remark

Once (\( {\widehat{L}}_{n+1}(D),{\widehat{L}}_{n+1} \)) has been computed, we know how many symbols it generates. Then, we incorporate the register to the “chain” depicted in Fig. 4.25 with the new “name” (\( {\widehat{L}}_{n^{\prime }}(D),{\widehat{L}}_{n^{\prime }} \)), where n ≥ n + 1 is the number of symbols produced. That information, together with \( {d}_{n^{\prime }} \), will be used in the construction of other registers with which to obtain more terms of the given sequence.

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Springer Nature Switzerland AG

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Sanvicente, E. (2019). Decoding RS and BCH Codes (Part 1). In: Understanding Error Control Coding. Springer, Cham. https://doi.org/10.1007/978-3-030-05840-1_4

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-05840-1_4

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-05839-5

  • Online ISBN: 978-3-030-05840-1

  • eBook Packages: EngineeringEngineering (R0)

Publish with us

Policies and ethics