0

I am trying to decode BCH codes using Peterson (PGZ) algorithm and have run into a problem I've not been able to find listed elsewhere.

I've found choice of polynomial to be important during the process (different irreducible polynomials yield different primitive elements), since I'm dealing with small codes (max 512 data bits, upto 4 errors) this can be resolved by trial and error.

For example, for BCH(15,7,5) the galois field is GF(2^4) and available irreducible polynomials are x^4+x+1, x^4+x^3+1, and x^4+x^3+x^2+x+1 which may or may not result in different primitive elements for the field, and thus the representation of field elements in terms of power of alpha also changes. This leads to different syndromes (again in terms of alpha) which again results in different coefficients of the error locator polynomial.

I have two questions about this decoding procedure:

  1. Right now I'm using trial and error to find which polynomial to use, is there a way of selecting the correct polynomial(s)? Earlier I was under the impression that the choice of polynomial did not matter.
  2. Some irreducible polynomials do not create a complete field - there are repeating elements, is this correct behaviour? I was under the impression all irreducible polynomials should give a field of unique elements. For ex, for GF(2^6) the polynomial x^6 + x^4 + x^2 + x + 1 gives 20 unique elements and then starts repeating elements.

Any help is appreaciated. Thanks

1 Answers1

1

Earlier I was under the impression that the choice of polynomial did not matter.

The choice of irreducible polynomial does not matter for the BCH code to work.

Some irreducible polynomials do not create a complete field

They create a complete field, but for non-primitive polynomials, $\alpha \ne x$. For $GF(2^6): x^6 + x^4 + x^2 + x + 1 : \alpha = x+1$.

Note that all fields of $GF(2^n)$ are isomporphic. Using a $n$ row by $n$ bit matrix any field of $GF(2^n)$ can be mapped to any other field $GF(2^n)$, where

$map(a \cdot b) = map(a) \cdot map(b)$
$map(a + b) = map(a) + map(b)$

and the mapped field will work as well as the original field for BCH.

I'm assuming you mean BCH(15,7,8), for $GF(2^4)$, lcm = least common multiple of the minimum polynomials, using any of:

$x^4+x+1: \alpha=x$ | lcm: $x^8+x^7+x^6+x^4+1$
$x^4+x^3+1: \alpha=x$ | lcm: $x^8+x^4+x^2+x+1$
$x^4+x^3+x^2+x+1: \alpha=x+1$ | lcm: $x^8+x^4+x^2+x+1$

I had no issues using any of these. Note that PGZ has time complexity $O((n-k)^3)$, while Berlekamp Massey or Sugiyama extended Euclid have time complexity $O((n-k)^2)$.


Example of a hardware 4 bit carryless multiply modulo $x^4+x^3+1$.
$p = a \cdot b \mod (x^4+x^3+1)$
$[0]$ is least significant bit, $[3]$ is most significant bit.
$x$[..] are powers of x

    x[0] = (a[0]&b[0]);
    x[1] = (a[0]&b[1])^(a[1]&b[0]);
    x[2] = (a[0]&b[2])^(a[1]&b[1])^(a[2]&b[0]);
    x[3] = (a[0]&b[3])^(a[1]&b[2])^(a[2]&b[1])^(a[3]&b[0]);
    x[4] = (a[1]&b[3])^(a[2]&b[2])^(a[3]&b[1]);
    x[5] = (a[2]&b[3])^(a[3]&b[2]);
    x[6] = (a[3]&b[3]);
/* POLY = x^4 + x^3           + 1 */

/* x^0 % POLY =                 1 */
/* x^1 % POLY =             x     */
/* x^2 % POLY =       x^2         */
/* x^3 % POLY = x^3               */
/* x^4 % POLY = x^3           + 1 */
/* x^5 % POLY = x^3       + x + 1 */
/* x^6 % POLY = x^3 + x^2 + x + 1 */
/*              ----------------- */
/*          p[    3     2   1   0]*/
p[0] = x[0]^x[4]^x[5]^x[6];
p[1] = x[1]^x[5]^x[6];
p[2] = x[2]^x[6];
p[3] = x[3]^x[4]^x[5]^x[6];

rcgldr
  • 764
  • Hi, this is helpful. While it is not the solution for my problem, it is the solution for this answer - that a for this polynomial is x+1 not x was the missing piece. Can you explain how you arrived to that (or point me somewhere that explains it?). Thanks. – Ayush Rawal Dec 24 '24 at 05:35
  • @AyushRawal - all non-zero elements are tested to see which ones are generators ($\alpha$) for a given field, via a brute force search. Rather than testing for a cycle of $2^n-1$, test for powers of all combinations of prime factors of $2^n-1$ except all of them for $\alpha^p \ne 1$. For $GF(2^8)$, the prime factors of $2^n-1 = 255$ are 3, 5,17, and the products of combinations are 15, 51, 85. The tests are $\alpha^{15} \ne 1$, $\alpha^{51} \ne 1$, $\alpha^{85} \ne 1$. For $GF(2^n)$, there are totient$(2^n-1)$ generators. For $GF(2^8)$, 128 generators. – rcgldr Dec 24 '24 at 09:11
  • a^15 (or another power) == 1 would imply a^15 (binary representation) is the generator polynomial - to be used for encoding, is that right? Does it have any significance in decoding?

    I am implementing this in verilog, a table that physically becomes a small ROM on a chip is preferable to larger matrix multiplication circuitry

    – Ayush Rawal Dec 24 '24 at 13:13
  • @AyushRawal - the requirement is $\alpha^p \ne 1$. If $\alpha^{15} = 1$, then it cycles every 15 elements and is not a generator. $\alpha$ is only needed if using log and antilog tables. For hardware, a carryless multiply modulo field polynomial may use fewer gates and doesn't use $\alpha$. I added an example to my answer. – rcgldr Dec 24 '24 at 16:10
  • @AyushRawal - for division, multiply by $1/d$. For a small field, use a table. For $GF(2^8)$, mapping to a composite | tower field such as $GF((2^4)^2)$ or $GF(((2^2)^2)^2)$ uses fewer gates. The mapping uses a 8 row by 8 bit matrix, and while generation of the matrix involves a search for a compatible $\alpha$, usage of the matrix does not involve $\alpha$. An example of this can be found in this answer . – rcgldr Dec 24 '24 at 17:10