By default, this page demonstrates how to create a generator polynomial for 13 error correction code words. If you would like to see the steps for creating generator polynomial for a different number of code words (up to 68), use the form below.

### Introduction to Creating a Generator Polynomial

Below, I will show the steps to create a generator polynomial for 13 error correction code words.

However, since we are working with the galois field GF256, we need to use special methods to make sure our numbers don't get too big or too small to stay in the galois field.

When we multiply two alpha values, normally we add the two exponents together. But if the result is bigger than 255, we have a problem.

For example, consider
α^{251} * α^{10}.
Multiplying these two gives us α^{261}, but that
is too big.

To prevent that from happening,
we put the resulting exponent through
the following formula:

(exponent % 256) + floor(exponent / 256)

Using the exponent of 261 from the above example, this gives
us:

(261 % 256) + floor(261 / 256) =
(5) + floor(1.01953125) = (5 + 1) = 6.

So when we multiply α^{251} * α^{10},
the result is α^{6}.

Another problem is combining like terms. Because of the nature of the galois field, we can't simply add the numbers together. We have to XOR them.

This will cause some unexpected results. For example:

α^{201}x^{2} + α^{199}x^{2}
= 56x^{2} + 14x^{2}

If we add those together normally, we get 70x^{2}. This number
is not larger than 255, so it would seem acceptable. However, if we
perform an XOR instead of addition, we get:

56 ⊕ 14 = 54.

This is the correct result. When adding like terms during the creation of a generator polynomial, you must always XOR the integers rather than adding them.

### How to Create a Generator Polynomial

In each step of creating a generator polynomial, you multiply a polynomial
by a polynomial. The very first polynomial that you start with in the
first step is always
*(α ^{0}x^{1}
+ α^{0}x^{0})*. For each multiplication step, you
multiply the current polynomial by

*(α*where

^{0}x^{1}+ α^{j}x^{0})*j*is 1 for the first multiplication, 2 for the second multiplication, 3 for the third, and so on.

### Multiplication Step #

We will multiply (α^{}x^{0}) by (α^{}x^{1} + α^{}x^{0})

After multiplying each term from the first
part with each term from the second part, we get:

(α^{}x^{0} * α^{}x^{1}) + (α^{}x^{0} * α^{}x^{0})

To multiply, you add the exponents together like this:

(α^{(+)}x^{(0+1)}) + (α^{(+)}x^{(0+0)})

After adding the exponents, this is the result:

α^{0}x^{1} + α^{0}x^{0}

If there are any exponents that are larger than 255,
fix them by putting them through the formula

(exponent % 256) + floor(exponent / 256). In this case, all the exponents are less than or equal to
255, so we can continue.

Now you have to combine terms that have the same exponent.
In this case, there is more than one term. Below is the final polynomial from this step after combining the like terms. **If we needed 1 error correction
code words, this would be the generator polynomial required.**

α^{}x^{1} + α^{}x^{0}

### Multiplication Step #

We will multiply (α^{}x^{0}) by (α^{}x^{1} + α^{}x^{0})

After multiplying each term from the first
part with each term from the second part, we get:

(α^{}x^{0} * α^{}x^{1}) + (α^{}x^{0} * α^{}x^{0})

To multiply, you add the exponents together like this:

(α^{(+)}x^{(0+1)}) + (α^{(+)}x^{(0+0)})

After adding the exponents, this is the result:

α^{0}x^{1} + α^{0}x^{0}

If there are any exponents that are larger than 255,
fix them by putting them through the formula

(exponent % 256) + floor(exponent / 256). In this case, all the exponents are less than or equal to
255, so we can continue.

Now you have to combine terms that have the same exponent.
In this case, there is more than one term. Below is the final polynomial from this step after combining the like terms. **If we needed 1 error correction
code words, this would be the generator polynomial required.**

α^{}x^{1} + α^{}x^{0}

### Multiplication Step #

We will multiply (α^{}x^{0}) by (α^{}x^{1} + α^{}x^{0})

After multiplying each term from the first
part with each term from the second part, we get:

(α^{}x^{0} * α^{}x^{1}) + (α^{}x^{0} * α^{}x^{0})

To multiply, you add the exponents together like this:

(α^{(+)}x^{(0+1)}) + (α^{(+)}x^{(0+0)})

After adding the exponents, this is the result:

α^{0}x^{1} + α^{0}x^{0}

If there are any exponents that are larger than 255,
fix them by putting them through the formula

(exponent % 256) + floor(exponent / 256). In this case, all the exponents are less than or equal to
255, so we can continue.

Now you have to combine terms that have the same exponent.
In this case, there is more than one term. Below is the final polynomial from this step after combining the like terms. **If we needed 1 error correction
code words, this would be the generator polynomial required.**

α^{}x^{1} + α^{}x^{0}

### Multiplication Step #

We will multiply (α^{}x^{0}) by (α^{}x^{1} + α^{}x^{0})

(α^{}x^{0} * α^{}x^{1}) + (α^{}x^{0} * α^{}x^{0})

(α^{(+)}x^{(0+1)}) + (α^{(+)}x^{(0+0)})

After adding the exponents, this is the result:

α^{0}x^{1} + α^{0}x^{0}

(exponent % 256) + floor(exponent / 256). In this case, all the exponents are less than or equal to
255, so we can continue.

**If we needed 1 error correction
code words, this would be the generator polynomial required.**

α^{}x^{1} + α^{}x^{0}

### Multiplication Step #

We will multiply (α^{}x^{0}) by (α^{}x^{1} + α^{}x^{0})

(α^{}x^{0} * α^{}x^{1}) + (α^{}x^{0} * α^{}x^{0})

(α^{(+)}x^{(0+1)}) + (α^{(+)}x^{(0+0)})

After adding the exponents, this is the result:

α^{0}x^{1} + α^{0}x^{0}

(exponent % 256) + floor(exponent / 256). In this case, all the exponents are less than or equal to
255, so we can continue.

**If we needed 1 error correction
code words, this would be the generator polynomial required.**

α^{}x^{1} + α^{}x^{0}

### Multiplication Step #

We will multiply (α^{}x^{0}) by (α^{}x^{1} + α^{}x^{0})

(α^{}x^{0} * α^{}x^{1}) + (α^{}x^{0} * α^{}x^{0})

(α^{(+)}x^{(0+1)}) + (α^{(+)}x^{(0+0)})

After adding the exponents, this is the result:

α^{0}x^{1} + α^{0}x^{0}

(exponent % 256) + floor(exponent / 256). In this case, all the exponents are less than or equal to
255, so we can continue.

**If we needed 1 error correction
code words, this would be the generator polynomial required.**

α^{}x^{1} + α^{}x^{0}

### Multiplication Step #

We will multiply (α^{}x^{0}) by (α^{}x^{1} + α^{}x^{0})

(α^{}x^{0} * α^{}x^{1}) + (α^{}x^{0} * α^{}x^{0})

(α^{(+)}x^{(0+1)}) + (α^{(+)}x^{(0+0)})

After adding the exponents, this is the result:

α^{0}x^{1} + α^{0}x^{0}

(exponent % 256) + floor(exponent / 256). In this case, all the exponents are less than or equal to
255, so we can continue.

**If we needed 1 error correction
code words, this would be the generator polynomial required.**

α^{}x^{1} + α^{}x^{0}

### Multiplication Step #

We will multiply (α^{}x^{0}) by (α^{}x^{1} + α^{}x^{0})

(α^{}x^{0} * α^{}x^{1}) + (α^{}x^{0} * α^{}x^{0})

(α^{(+)}x^{(0+1)}) + (α^{(+)}x^{(0+0)})

After adding the exponents, this is the result:

α^{0}x^{1} + α^{0}x^{0}

(exponent % 256) + floor(exponent / 256). In this case, all the exponents are less than or equal to
255, so we can continue.

**If we needed 1 error correction
code words, this would be the generator polynomial required.**

α^{}x^{1} + α^{}x^{0}

### Multiplication Step #

We will multiply (α^{}x^{0}) by (α^{}x^{1} + α^{}x^{0})

(α^{}x^{0} * α^{}x^{1}) + (α^{}x^{0} * α^{}x^{0})

(α^{(+)}x^{(0+1)}) + (α^{(+)}x^{(0+0)})

After adding the exponents, this is the result:

α^{0}x^{1} + α^{0}x^{0}

(exponent % 256) + floor(exponent / 256). In this case, all the exponents are less than or equal to
255, so we can continue.

**If we needed 1 error correction
code words, this would be the generator polynomial required.**

α^{}x^{1} + α^{}x^{0}

### Multiplication Step #

We will multiply (α^{}x^{0}) by (α^{}x^{1} + α^{}x^{0})

(α^{}x^{0} * α^{}x^{1}) + (α^{}x^{0} * α^{}x^{0})

(α^{(+)}x^{(0+1)}) + (α^{(+)}x^{(0+0)})

After adding the exponents, this is the result:

α^{0}x^{1} + α^{0}x^{0}

(exponent % 256) + floor(exponent / 256). In this case, all the exponents are less than or equal to
255, so we can continue.

**If we needed 1 error correction
code words, this would be the generator polynomial required.**

α^{}x^{1} + α^{}x^{0}

### Multiplication Step #

We will multiply (α^{}x^{0}) by (α^{}x^{1} + α^{}x^{0})

(α^{}x^{0} * α^{}x^{1}) + (α^{}x^{0} * α^{}x^{0})

(α^{(+)}x^{(0+1)}) + (α^{(+)}x^{(0+0)})

After adding the exponents, this is the result:

α^{0}x^{1} + α^{0}x^{0}

(exponent % 256) + floor(exponent / 256). In this case, all the exponents are less than or equal to
255, so we can continue.

**If we needed 1 error correction
code words, this would be the generator polynomial required.**

α^{}x^{1} + α^{}x^{0}

### Multiplication Step #

We will multiply (α^{}x^{0}) by (α^{}x^{1} + α^{}x^{0})

(α^{}x^{0} * α^{}x^{1}) + (α^{}x^{0} * α^{}x^{0})

(α^{(+)}x^{(0+1)}) + (α^{(+)}x^{(0+0)})

After adding the exponents, this is the result:

α^{0}x^{1} + α^{0}x^{0}

(exponent % 256) + floor(exponent / 256). In this case, all the exponents are less than or equal to
255, so we can continue.

**If we needed 1 error correction
code words, this would be the generator polynomial required.**

α^{}x^{1} + α^{}x^{0}

Final result:

(α^{}x^{0})