2

My question: Let $\alpha$ be a root of $1+x+x^4 \in \text{F}_{2}\left[x\right]$ and let C be a narrow-sense BCH code with length 15, and designed distance 5.

Find the generator polynomial of $C$ and determine the error position of $100000111000000$.

My work so far:

If $\alpha$ is a root of $1+x+x^4 \in \text{F}_{2}\left[x\right]$ and $C$ is a narrow-sense BCH code with parameters with length 15 and designed distance 5, then a generator polynomial is

$g\left(x\right)=\text{lcm}\left(1+x+x^4\right)\left(1+x+x^2+x^3+x^4\right)=1+x^4+x^6+x^7+x^8$

and we also noted that this code will be able to correct 2 errors, from the equation for designed distance $d=2\delta +1$, and because the degree of $g\left(x\right)$ is $8$, we will have a $\left[15, 7, 5\right]$ narrow-sense BCH code.

Now in order to decode the received word $w\left(x\right)=\left(w_{0}+w_{1}x+...+w_{n-1}x^{n-1}\right)=100000111000000$, first we check

$w\left(x\right)H^{T}=0$, where $H$ is the parity check matrix given by

\begin{bmatrix}1 & \alpha & \alpha^{2} &. . . & \alpha^{14} \\1 & \alpha^{3} & \alpha^{9}&...&\alpha^{12} \end{bmatrix}

and if $w\left(x\right)H^{T}=0$ we conclude that there is no error. If $w\left(x\right)H^{T} \neq 0$, next we calculate the syndromes $\left(s_{0}, s_{1}, ..., s_{\delta-2}\right)=\left(w_{0}, w_{1}, ..., w_{n-1}\right)H^{T}$, where $s_{i}=e\left(\alpha^{i+1}\right)$ is the error locator polynomial.

Because we have a two error pattern, we will need to find the error polynomial to decode $c\left(x\right)=w\left(x\right)-e\left(x\right)$.

We do this in the following way.

First we consider the system of equations

\begin{align*} \alpha_{1} + \alpha_{2} &= \,s_{1} \\ \alpha_{1}^{3}+\alpha_{2}^{3} &= \, s_{2} \\ \end{align*}

and noting $$\alpha_{1}^{3}+\alpha_{2}^{3}=\underbrace{\left(\alpha_{1}+\alpha_{2}\right)}_{s_{1}} \underbrace{\left(\alpha_{1}^{2}+\alpha_{1}\alpha_{2}+\alpha_{2}^{2}\right)}_{s^{2}_{1}+\alpha_{1}\alpha_{2}}$$

Then, rewriting the two equations for $\alpha_{1}$ and $\alpha_{2}$,

\begin{align*} \alpha_{1} + \alpha_{2} &= \,s_{1} \\ \alpha_{1}^{3} \cdot \alpha_{2}^{3} &= \, s_{2}s_{1}^{-1}+s_{1}^{2}=\frac{s_{2}+s_{1}^{3}}{s_{1}} \\ \end{align*}

and finally we construct a quadratic equation whose roots are $\alpha_{1}$ and $\alpha_{2}$,

$\left(x-\alpha_{1}\right)\left(x-\alpha_{2}\right)=x^2-\left(\alpha_{1}+\alpha_{2}\right)+\alpha_{1}\alpha_{2}=x^2+s_{1}x+\frac{s_{2}+s_{1}^{3}}{s_{1}}$.

What is giving me trouble:

So after all of this my question is really where to go from here. Do I simply solve the quadratic equations for the roots of $x^2+s_{1}x+\frac{s_{2}+s_{1}^{3}}{s_{1}}$, or is there another detail I am missing? As always, thanks for the help.

Chairman Meow
  • 806
  • 1
  • 9
  • 27
  • 1
    A typo $\alpha_1^2+\alpha_1\alpha_2+\alpha_2^2=s_1^2+\alpha_1\alpha_2$! Anyway, the point here is to write the product $\alpha_1\alpha_2$ in terms of the syndromes, and end up with $\alpha_1\alpha_2=(s_2+s_1^3)/s_1$. So the quadratic in the end is correct. – Jyrki Lahtonen Apr 30 '21 at 04:34
  • Ahh I see. So I don't need to solve for the quadratic, I need to get the product $\alpha_{1}\alpha_{2}$ in terms of the syndromes? – Chairman Meow Apr 30 '21 at 04:37
  • 1
    Anyway, you do want to solve that quadratic to find the error locations. There are special cases. 1) May be only one error occurred? This is not really a problem because this shows as the possibility $\alpha_2=0$, which happens if and only if $s_2=s_1^3$. 2) The quadratic may not have solutions in $\Bbb{F}_{16}$. This is an indication that more than two errors occured, and there is nothing much you can do about it. – Jyrki Lahtonen Apr 30 '21 at 04:40
  • Ohhh I understand now. Thank you for the help. – Chairman Meow Apr 30 '21 at 04:41
  • 1
    Over the field $\Bbb{F}_{2^m}$ the quadratic $$x^2+ax+b=0$$ has two roots if and only if $a\neq0$ and $tr(b/a^2)=0$, where $tr(z)$ stands for the trace. – Jyrki Lahtonen Apr 30 '21 at 04:41
  • 1
    IIRC some practical decoder implementations resort to the so called Chien search, where you basically test consecutive powers of $\alpha$ for being zeros of the error locator polynomial $E(x)$, and flip the corresponding received bit when you find one. This is not as dumb as it sounds, because there are recurrence relations satisfied by $E(\alpha^i)$ making it more efficient. If you do that, you need to keep track that your search found a sufficient number of zeros of $E(x)$. – Jyrki Lahtonen Apr 30 '21 at 04:47
  • 2
    There is the further point that the quadratic formula does not work in characteristic two, so solving those zeros algebraically is a bit strange. You can use the so called half-trace, but I'm not sure that is very efficient either. If Dilip Sarwate shows up, he can comment. – Jyrki Lahtonen Apr 30 '21 at 04:48
  • That is so cool! Thank you for the feedback, you always leave very helpful/motivating comments. I really appreciate the help. I will try to locate the errors and post what I discover. – Chairman Meow Apr 30 '21 at 05:00
  • 1
    The Chien search is a very practical method for finding which bits are in error and correcting the erroneous bits (which is just "flipping" the bit in question) because the determination that a specific bit is in error is done just as the bit is ready to leave the decoder, and if the bit is incorrect, flipping the bit on its way out of the decoder into the cold gray world outside. It is not a very useful method for mathematicians working out the answers with paper and pencil. Berlekamp's Algebraic Coding Theory discusses the solution of quadratics over fields of characteristic 2. – Dilip Sarwate May 04 '21 at 19:09
  • I will have to find a copy. Do you know of any software that is available so that I can check my work more easily? Working with small codes with pencil and paper is fine, but anything like $GF\left(16\right)$ and beyond quickly gets very difficult for me and it would be nice to have a way to check my work. – Chairman Meow May 04 '21 at 19:27
  • @JyrkiLahtonen - for $GF(2^n$), a lookup table for a root of $x^2 + x + c$ with $2^n$ entries can be used to speed up solving $x^2 + ax + b$. If $a=0$ or $b=0$, there are not two unique roots. $c=b/a^2$, $r$ = table[$c$]. The two roots are $(ar)$ and $(ar)+a$. A similar method can be used for cubic equations, using two look up tables. – rcgldr Oct 28 '24 at 08:15
  • @rcgldr I'm aware about the quadratics :-). The table is a linear function on $c$ (within the kernel of the trace). – Jyrki Lahtonen Nov 06 '24 at 14:42
  • 1
    @JyrkiLahtonen - I posted a question looking for a reference for solving both quadratics and cubics as presented in a paper by Prof E J Weldon Jr (University of Hawaii) around 1987 to a company I worked for at that time. The cubic solution is less obvious. – rcgldr Nov 06 '24 at 17:59
  • @JyrkiLahtonen - quadratic for $GF(2^8):x^8+x^4+x^3+x+1$, linear mapping can be used instead of a table (for hardware), bit indexes, a[] input, z[] output, + is xor: if a[5] == 1 invalid | z[0] = 0 | z[1] = a[0]+a[2]+a[4] | z[2] = a[0]+a[3]+a[4]+a[6] | z[3] = a[1]+a[2]+a[3]+a[4] | z[4] = a[0]+a[7] | z[5] = a[1]+a[2]+a[3]+a[4]+a[6] | z[6] = a[0]+a[1]+a[2]+a[4]+a[7] | z[7] = a[0]+a[1]+a[2]+a[4] . Other root is z[0] = 1. – rcgldr Nov 07 '24 at 12:38

1 Answers1

0

After taking the comments above into consideration, I believe I have found the solution.

So, using the transpose of $H$,

$$H^{T} = \begin{bmatrix} 1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 & 0 & 0 & 1 & 1 \\ 0 & 0 & 0 & 1 & 0 & 1 & 0 & 1 \\ 1 & 1 & 0 & 0 & 1 & 1 & 1 & 1 \\ 0 & 1 & 1 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 1 & 0 & 0 & 0 & 1 \\ 1 & 1 & 0 & 1 & 0 & 0 & 1 & 1 \\ 1 & 0 & 1 & 0 & 0 & 1 & 0 & 1 \\ 0 & 1 & 0 & 1 & 1 & 1 & 1 & 1 \\ 1 & 1 & 1 & 0 & 1 & 0 & 0 & 0 \\ 0 & 1 & 1 & 1 & 0 & 0 & 0 & 1 \\ 1 & 1 & 1 & 1 & 0 & 0 & 1 & 1 \\ 1 & 0 & 1 & 1 & 0 & 1 & 0 & 1 \\ 1 & 0 & 0 & 1 & 1 & 1 & 1 & 1 \end{bmatrix} $$,

and setting $w\left(x\right)=\begin{bmatrix} 1 & 0 & 0 & 0 &0 &0& 1& 1& 1& 0& 0& 0& 0& 0& 0\end{bmatrix}$

then $$w\left(x\right)H^{T}=\begin{bmatrix} 1 & 1 & 0 & 0 & 1 & 1 & 1 & 1 \end{bmatrix}^T=\begin{bmatrix} 1\\ 1\\ 0\\ 0\\ 1\\ 1\\ 1\\ 1 \end{bmatrix}=\begin{bmatrix} \alpha^{4}\\ \alpha^{12}\\ \end{bmatrix}=\begin{bmatrix} s_{1}\\ s_{2}\\ \end{bmatrix}$$

Now solving for $x^2+s_{1}x+\frac{s_{2}+s_{1}^{3}}{{s_{1}}}=0$,

$$x^2+\alpha^{4}x+\frac{\alpha^{12}+\left(\alpha^{4}\right)^{3}}{\alpha^{4}}=0$$

$$\implies x^2+\alpha^{4}+2\alpha^{8}=x^2+\alpha^{4}$$

is the error check polynomial.

We can check this with $$s\left(x\right)=\left(x-\alpha^{2}\right)\left(x-\alpha^{2}\right)=x^2+\alpha^4$$

So taking this into consideration we can conclude that the errors were in the fourth and twelfth positions.

Chairman Meow
  • 806
  • 1
  • 9
  • 27
  • For smaller fields, quadratic equations for $GF(2^n)$ can be solved using a $2^n$ entry lookup table. The table consists of one root of $x^2 + x + c$ indexed by $c$. Find the roots of $x^2 + ax + b$: If $a = 0$ or $b=0$ there are not two unique roots. $c = b/a^2$, $r$ = table[$c$]. The two roots are $(a r)$ and $(a r) + a$. A similar method can be used for cubic equations, using two look up tables. – rcgldr Oct 28 '24 at 03:03
  • @rcgldr There are no solutions when $tr(c)=1$. And using linearity you only need a table with $(n-1)$ entries (= the dimension of the kernel of the trace). Admittedly works better with some basis than others because it usually isn't obvious how you get a basis for the kernel of the trace. Another look up table with $n-1$ entries will do that. – Jyrki Lahtonen Nov 07 '24 at 12:57
  • @JyrkiLahtonen - there are normal basis tower fields when tr(c) = 1 has a solution. For example $GF(2^2)$, where elements are of the form $w_2 W^2 + w_1 W$, where $w_2$ and $w_1$ are single bit parts of $GF(2^2)$, and $W$ is an element of $GF(2^8)$. In this case $w^2+w+1$ has a solution as show in this question, about an optimized hardware inversion step for an AES S-Box. – rcgldr Nov 07 '24 at 17:48
  • @JyrkiLahtonen - any $GF(2^n)$ field can be isomorphically mapped to another $GF(2^n)$ field using a $n$ row by $n$ bit matrix $M$, where map(ab) = map(a)map(b) and map(a+b) = map(a)+map(b). For hardware implementations, there is some field where the linear mapping for $x^2+x+c$ is straight forward, and only requires checking a single bit of $c$ for an invalid case, and using a $n$ row by $n$ bit matrix $Q$ to produce a $root$ (the other is $root+1$), and for any field, the $n$ by $n$ matrix is $MQM^{-1}$. There is parallel circuitry to check for an invalid case. – rcgldr Nov 07 '24 at 18:06