Error Correction Coding

Error correction codewords allow QR code readers to detect and correct errors in QR codes. This page explains how to create these error correction codewords after encoding the data.

Step 1: Break Data Codewords into Blocks if Necessary

Before generating error correction codewords, it may be necessary to break up the data codewords into smaller blocks if the QR code is larger than version 2. As an example, if creating a 5-Q QR code, the error correction table says that a 5-Q code has 62 data codewords (strings of 8-bit binary numbers). For example:

(codeword #1) 01000011
(codeword #2) 01010101
(codeword #3) 01000110
(codeword #4) 10000110
(codeword #5) 01010111
(codeword #6) 00100110
(codeword #7) 01010101
(codeword #8) 11000010
(codeword #9) 01110111
(codeword #10) 00110010
(codeword #11) 00000110
(codeword #12) 00010010
(codeword #13) 00000110
(codeword #14) 01100111
(codeword #15) 00100110
(codeword #16) 11110110
(codeword #17) 11110110
(codeword #18) 01000010
(codeword #19) 00000111
(codeword #20) 01110110
(codeword #21) 10000110
(codeword #22) 11110010
(codeword #23) 00000111
(codeword #24) 00100110
(codeword #25) 01010110
(codeword #26) 00010110
(codeword #27) 11000110
(codeword #28) 11000111
(codeword #29) 10010010
(codeword #30) 00000110
(codeword #31) 10110110
(codeword #32) 11100110
(codeword #33) 11110111
(codeword #34) 01110111
(codeword #35) 00110010
(codeword #36) 00000111
(codeword #37) 01110110
(codeword #38) 10000110
(codeword #39) 01010111
(codeword #40) 00100110
(codeword #41) 01010010
(codeword #42) 00000110
(codeword #43) 10000110
(codeword #44) 10010111
(codeword #45) 00110010
(codeword #46) 00000111
(codeword #47) 01000110
(codeword #48) 11110111
(codeword #49) 01110110
(codeword #50) 01010110
(codeword #51) 11000010
(codeword #52) 00000110
(codeword #53) 10010111
(codeword #54) 00110010
(codeword #55) 11100000
(codeword #56) 11101100
(codeword #57) 00010001
(codeword #58) 11101100
(codeword #59) 00010001
(codeword #60) 11101100
(codeword #61) 00010001
(codeword #62) 11101100

The error correction table mentions "group 1" and "group 2", as well as "number of blocks." This means that the data codewords must be split up into up to two groups, and within each group, the data codewords may be further broken up into blocks. The data codewords are broken up sequentially (i.e. starting with codeword 1, then codeword 2, and so on.)

For a 5-Q code, it says that there are two groups, the first of which should be broken up into 2 blocks that each contain 15 data codewords, and the second of which should be broken up into 2 blocks that each contain 16 data codewords. Notice that 15+15+16+16 = 62, which is the total number of data codewords. Below, are the codewords from above, broken up into the correct groups and blocks to illustrate how to do this step.

Group NumberBlock NumberData Codewords in the Group
Group 1Block 1 (codeword #1) 01000011
(codeword #2) 01010101
(codeword #3) 01000110
(codeword #4) 10000110
(codeword #5) 01010111
(codeword #6) 00100110
(codeword #7) 01010101
(codeword #8) 11000010
(codeword #9) 01110111
(codeword #10) 00110010
(codeword #11) 00000110
(codeword #12) 00010010
(codeword #13) 00000110
(codeword #14) 01100111
(codeword #15) 00100110
Block 2(codeword #16) 11110110
(codeword #17) 11110110
(codeword #18) 01000010
(codeword #19) 00000111
(codeword #20) 01110110
(codeword #21) 10000110
(codeword #22) 11110010
(codeword #23) 00000111
(codeword #24) 00100110
(codeword #25) 01010110
(codeword #26) 00010110
(codeword #27) 11000110
(codeword #28) 11000111
(codeword #29) 10010010
(codeword #30) 00000110
Group 2Block 1(codeword #31) 10110110
(codeword #32) 11100110
(codeword #33) 11110111
(codeword #34) 01110111
(codeword #35) 00110010
(codeword #36) 00000111
(codeword #37) 01110110
(codeword #38) 10000110
(codeword #39) 01010111
(codeword #40) 00100110
(codeword #41) 01010010
(codeword #42) 00000110
(codeword #43) 10000110
(codeword #44) 10010111
(codeword #45) 00110010
(codeword #46) 00000111
Block 2(codeword #47) 01000110
(codeword #48) 11110111
(codeword #49) 01110110
(codeword #50) 01010110
(codeword #51) 11000010
(codeword #52) 00000110
(codeword #53) 10010111
(codeword #54) 00110010
(codeword #55) 11100000
(codeword #56) 11101100
(codeword #57) 00010001
(codeword #58) 11101100
(codeword #59) 00010001
(codeword #60) 11101100
(codeword #61) 00010001
(codeword #62) 11101100

In the table, notice that the blocks in group 1 consist of 15 data codewords, and the blocks in group 2 consist of 16 data codewords as specified in the error correction table. Note also that they are broken up sequentially. That is, they are in the same order as they were before being separated into blocks.

The error correction table also says that for a 5-Q code, there are 18 error correction codewords per block. In this example, there are four blocks, so there will be four sets of 18 error correction codewords, for a total of 72 error correction codewords.

As shown in the error correction table, the smaller QR codes do not require the data codewords to be broken up at all, so, for a 1-M code (for example) all 16 data codewords would be used as a single block, and only 10 error correction codewords would need to be generated.

Before continuing the 5-Q example, it is necessary to explain the underlying steps of Reed-Solomon Error correction.

Step 2: Understand Polynomial Long Division

The error correction codewords will be generated using a method called Reed-Solomon Error correction. Part of the process is to perform polynomial long division. That is, dividing one polynomial by another polynomial. This tutorial assumes an understanding of how to do standard long division (i.e. with numbers rather than polyomials) by hand. For more information, read wikiHow's article about how to do long division.

Polynomial long division is slightly more complicated than standard long division. To help clarify the process, here is a simple example of polynomial long division.

This example show 3x2 + x - 1 (the dividend) divided by x + 1 (the divisor). These polynomials are first put into a tableau (see Wikipedia's article on long division for an explanation of this notation).

_____________
x + 1 |3x2 +  x - 1

In each step of the long division, multiply x + 1 by something to make its first term equal that of the polynomial at the bottom of the tableau.

For the first step, 3x2 + x - 1 is at the bottom of the tableau, so multiply x + 1 by 3x. This results in 3x2 + 3x, which has the same first term as that of the polynomial at the bottom of the tableau. Here is the updated tableau.

3x              
x + 1 |3x2 +  x - 1
3x2 + 3x

Now subtract 3x2 + 3x from 3x2 + x - 1. This results in -2x - 1 (because x - 3x is (1 - 3)x, or -2x). The - 1 at the end is carried over from the original polynomial. Here is the updated tableau.

3x              
x + 1 |3x2 +  x - 1
3x2 + 3x
    - 2x - 1

Now, once again, multiply x + 1 by a term that will result in a polynomial whose first term is the same as that of the bottom polynomial. In this case, do -2 (x + 1) to get -2x - 2. Here is the updated tableau.

3x - 2      
x + 1 |3x2 +  x - 1
3x2 + 3x
    - 2x - 1
    - 2x - 2

And now, once again, subtract the two polynomials. The -2x cancels out, but this leaves -1 - 2, which equals 1, as shown in the final tableau below.

3x - 2      
x + 1 |3x2 +  x - 1
3x2 + 3x
    - 2x - 1
    - 2x - 2
           1

The remainder is 1. Technically it is 1x0. It would be necessary to multiply (x + 1) by 1/x to make the first term the same, but since this is a fraction, it means that no further division is possible. The 1 at the bottom of the tableau is the remainder.

Overall, the steps of polynomial long division are:

  1. Find the appropriate term to multiply the divisor by. The result of the multiplication should have the same first term as the the dividend (in the first multiplication step) or remainder (in all subsequent multiplication steps).
  2. Subtract the result from the dividend (in the first multiplication step) or remainder (in all subsequent multiplication steps).
  3. Repeat steps 1 and 2 until it is no longer possible to multiply by an integer, or in other words, it would be necessary to multiply by a fraction. The number at the bottom of the tableau is the remainder.

The polynomial long division necessary for Reed-Solomon Error Correction is simpler in some ways than this example, because it will not be necessary to deal with the exponents of the polynomial terms.

Step 3: Understand The Galois Field

As mentioned in the previous section, to generate error correction codewords, this process uses a method called Reed-Solomon Error correction. Along with polynomial long division, this method uses a Galois field, which is essentially a restricted set of numbers, as well as some mathematical operations that create numbers that are still in that set.

The QR Code standard says to use bit-wise modulo 2 arithmetic and byte-wise modulo 100011101 arithmetic. This means using Galois Field 28, or in other words Galois Field 256, sometimes written as GF(256).

The numbers in GF(256) will all be in the range of 0 through 255 (inclusive). Notice that this is the same range of numbers that can be represented with an eight-bit byte (the largest possible eight-bit byte is 11111111, which equals 255).

This means that all of the mathematical operations in GF(256) will result in numbers that can be represented as eight-bit bytes.

Step 4: Understand Galois Field Arithmetic

As mentioned previously, GF(256) contains the numbers 0 through 255 inclusive. Mathematical operations in GF(256) are cyclical in nature, meaning that if a mathematical operation is performed within GF(256) that results in a number larger than 255, it will be necessary to use the modulo operation to get a number that is still in the Galois Field.

In the Galois Field, negative numbers have the same value as positive numbers, so -n = n. In other words, always use the absolute value of the numbers involved in Galois Field arithmetic.

This means that addition and subtraction within the Galois Field are the same thing. Addition and subtraction in the Galois Field are performed by doing the addition or subtraction as normal, but then performing the modulo operation. And since we are using bit-wise modulo 2 arithmetic (as mentioned in the QR code specification), this is the same as performing the XOR operation. For example:
1 + 1 = 2 % 2 = 0
or
1 ^ 1 = 0

and

0 + 1 = 1 % 2 = 1
or
0 ^ 1 = 1

For the purposes of encoding a QR code, all addition and subtraction in GF(256) is performed by XORing the two numbers together.

Step 5: Generate Powers of 2 using Byte-Wise Modulo 100011101

All of the numbers in GF(256) can be represented as a power of 2. Specifically, all numbers in GF(256) can be represented as 2n, where 0 8 would seem to be too big for the Galois Field since it is equal to 256.

The powers of 2 from 0 to 8 are:
20 = 1
21 = 2
22 = 4
23 = 8
24 = 16
25 = 32
26 = 64
27 = 128
28 = 256

The QR code specification says to use byte-wise modulo 100011101 arithmetic (where 100011101 is a binary number that is equivalent to 285 in decimal). This means that when a number is 256 or larger, it should be XORed with 285. This leads to unexpected values for 28 and larger.

In other words:
28 = 256 ^ 285 = 29

Note that when continuing on to 29, do not take its usual value of 512 and XOR with 285 (which would result in too large a number anyway). Instead, since 29 = 28 * 2, use the value of 28 that was calculated in the previous step.

In other words:
29 = 28 * 2 = 29 * 2 = 58

Continue using the previous power of 2 to create the next powers of 2:
210 = 29 * 2 = 58 * 2 = 116
211 = 210 * 2 = 116 * 2 = 232

Whenever a value greater than or equal to 256 is obtained, once again XOR with 285:
212 = 211 * 2 = 232 * 2 = 464 ^ 285 = 205

In general, the values are always equal to 2 times the previous power, and if that value is 256 or greater, it is XORed with 285.

Using this procedure, all numbers in GF(256) can be represented with 2n, where n is a number in the range 0

Step 6: Understand Multiplication with Logs and Antilogs

Because all of the values can be represented with 2n as explained above, it is possible to logs and antilogs to simplify multiplication in GF(256). (Incidentally, this is what slide rules do, although they are not restricted to GF(256)).

The simplification is possible because, in general (i.e. not just in Galois Fields), one can multiply two numbers p and q with the following operation:
b(logbp + logbq)

In this case, base 2 is in use, so the above operation becomes
2(log2p + log2q)
And the log2x operation tells us how many times to multiply 2 to get an answer of x. In other words, it determines n where 2n = x.

This provides a shortcut for multiplying numbers in GF(256). When multiplying two numbers that have the same base, such as 22 * 28, this is equivalent to adding the two exponents together, like so:

22 * 28 = 2(2 + 8) = 210

This means that since all GF(256) values have been expressed as powers of two (explained in the previous section), all multiplication in GF(256) can be performed as addition of base-2 exponents.

For example, to multiply 16 * 32, this is the same as multiplying 24 by 25. As the previous paragraph explained, this is the same as 2(4 + 5) or 29. The value of 29 was already calculated, therefore in GF(256) with byte-wise modulo 285, 16 * 32 is 29, which was determined in the previous section to be equal to 58.

When adding exponents, if the exponent becomes greater than or equal to 256, simply apply modulo 255. In other words:

2170 * 2164 = 2(170+164) = 2334 → 2334 % 255 = 279.

Therefore, all that is needed to perform multiplication in GF(256) is to generate all the powers of 2. These values have been calculated already and can be found in the log antilog table. The table uses alpha notation, where α = 2. The QR Code specification also uses alpha notation in Annex A.

Step 7: Understanding The Generator Polynomial

We have made a lot of progress toward generating error correction codewords, but we are not quite there yet. The next step is understanding generator polynomials.

As mentioned earlier, error correction coding uses polynomial long division. To do that, two polynomials are needed. The first polynomial to use is called the message polynomial. The message polynomial uses the data codewords from the data encoding step as its coefficients. For example, if the data codewords, converted to integers, were 25, 218, and 35, the message polynomial would be 25x2 + 218x + 35. In practice, real message polynomials for standard QR codes are much longer, but this is just an example.

The message polynomial will be divided by a generator polynomial. The generator polynomial is a polynomial that is created by multiplying
(x - α0) ... (x - αn-1)
where n is the number of error correction codewords that must be generated (see the error correction table). As mentioned in the previous section, α (alpha) is equal to 2.

It is possible to programmatically create all the generator polynomials that might be needed. During the process, this tutorial will make use of alpha notation and the log antilog multiplication that was described earlier on this page.

The QR code specification lists generator polynomials in Annex A, starting with 2 and ending with 68. Although standard QR codes will always require more than 2 error correction codewords per block, this page will show how to calculate the generator polynomial for 2 error correction codewords, because it illustrates the process of calculating all the rest of the generator polynomials as well.

Generator Polynomial for 2 Error Correction Codewords

First, multiply (x - α0) and (x - α1).
Since the coefficient of x is 1, and since α0 = 1, this can be written as
0x - α0) * (α0x - α1)

Multiply each term of the first part by each term of the second part to get this:
0x1 * α0x1) + (α0x0 * α0x1) + (α0x1 * α1x0) + (α0x0 * α1x0)

Notice that exponent addition can be used here to perform the multiplications:
(0+0)x(1+1)) + (α(0+0)x(0+1)) + (α(0+1)x(1+0)) + (α(0+1)x(0+0))

The result:
α0x2 + α0x1 + α1x1 + α1x0

Now, combine like terms. There are two x1 terms, so add them together.
α0x2 + (α01)x1 + α1x0

Remember that addition in GF(256) is performed by XOR. Convert the alphas to their integer counterparts using the log antilog table, then perform the XOR.

x2 + (1^2)x1 + 2x0
x2 + 3x1 + 2x0

Back in alpha notation, this is
α0x2 + α25x1 + α1x0
This is the generator polynomial for 2 error correction codewords.

Generator Polynomial for 3 Error Correction Codewords

All the rest of the generator polynomials can be created the same way, using the generator polynomial from each previous step. Start with the previous generator polynomial and multiply it by the next factor, in this case (x - α2)

0x2 + α25x1 + α1x0) * (α0x1 + α2x0)

0x2 * α0x1) + (α25x1 * α0x1) + (α1x0 * α0x1) + (α0x2 * α2x0) + (α25x1 * α2x0) + (α1x0 * α2x0)

To multiply, add the exponents together like this:
(0+0)x(2+1)) + (α(25+0)x(1+1)) + (α(1+0)x(0+1)) + (α(0+2)x(2+0)) + (α(25+2)x(1+0)) + (α(1+2)x(0+0))

After adding the exponents, this is the result:
α0x3 + α25x2 + α1x1 + α2x2 + α27x1 + α3x0

Now combine like terms.
α0x3 + (α25 ^ α2)x2 + (α1 ^ α27)x1 + α3x0

α0x3 + (3 ^ 4)x2 + (2 ^ 12)x1 + α3x0
α0x3 + 7x2 + 14x1 + α3x0
α0x3 + α198x2 + α199x1 + α3x0

This is the generator polynomial for 3 error correction codewords.

When the Exponents are Greater than or Equal to 256

When performing multiplication by adding exponents together, sometimes this may result in an exponent that is greater than or equal to 256. In this case, apply modulo 255 BEFORE combining like terms. For example
α257x4 = α(257 % 255)x4 = α2x4

Other Generator Polynomials

In general, it is possible to create all the generator polynomials g(x) as illustrated below:
(g(x) for 2 error correction codewords) * (x - α2) = (g(x) for 3 error correction codewords)
(g(x) for 3 error correction codewords) * (x - α3) = (g(x) for 4 error correction codewords)
(g(x) for 4 error correction codewords) * (x - α4) = (g(x) for 5 error correction codewords)
...
(g(x) for n-1 error correction codewords) * (x - αn-1) = (g(x) for n error correction codewords)

To obtain a specific generator polynomial without having to calculate it programmatically, the generator polynomial tool can create it.

Step 8: Generating Error Correction Codewords

Now it is finally time to start generating error correction codewords. This part uses the data codewords from the HELLO WORLD example on the alphanumeric mode encoding page. These codewords will be used as the coefficients of the message polynomial. This example uses error correction level M, and version 1, to create a 1-M code.

The Message Polynomial

The data encoding step resulted in the following data codewords for HELLO WORLD as a 1-M code.
00100000 01011011 00001011 01111000 11010001 01110010 11011100 01001101 01000011 01000000 11101100 00010001 11101100 00010001 11101100 00010001

Convert those binary numbers into decimal:
32, 91, 11, 120, 209, 114, 220, 77, 67, 64, 236, 17, 236, 17, 236, 17

These numbers are the coefficients of the message polynomial. In other words:
32x15 + 91x14 + 11x13 ... and so on

The Generator Polynomial

First, get the generator polynomial. Since this is a 1-M code, the error correction table says to create 10 error correction codewords. Therefore, use the following generator polynomial:
x10 + α251x9 + α67x8 + α46x7 + α61x6 + α118x5 + α70x4 + α64x3 + α94x2 + α32x + α45

(Refer to the generator polynomial tool and the discussion about generator polynomials earlier on this page.)

The Division Steps

Now it is time to divide the message polynomial by the generator polynomial. This is done in much the same way as the polynomial long division shown earlier on the page. Here are the division steps, updated to take Galois Field arithmetic into account:

  1. Find the appropriate term to multiply the generator polynomial by. The result of the multiplication should have the same first term as the the message polynomial (in the first multiplication step) or remainder (in all subsequent multiplication steps).
  2. XOR the result with the message polynomial (in the first multiplication step) or remainder (in all subsequent multiplication steps).
  3. Perform these steps n times, where n is the number of data codewords.

Notice the differences between these steps and those of normal polynomial long division. Instead of subtracting after the multiplication step, we perform an XOR (which, in GF(256), is the same thing).

More importantly, after dividing the two polynomials, there will be a remainder. The coefficients of this remainder are the error correction codewords.

The division will be illustrated step-by-step in the next section.

Step 9: Divide the Message Polynomial by the Generator Polynomial

The first step to the division is to prepare the message polynomial for the division. The full message polynomial is:

32x15 + 91x14 + 11x13 + 120x12 + 209x11 + 114x10 + 220x9 + 77x8 + 67x7 + 64x6 + 236x5 + 17x4 + 236x3 + 17x2 + 236x1 + 17

To make sure that the exponent of the lead term doesn't become too small during the division, multiply the message polynomial by xn where n is the number of error correction codewords that are needed. In this case n is 10, for 10 error correction codewords, so multiply the message polynomial by x10, which gives us:

32x25 + 91x24 + 11x23 + 120x22 + 209x21 + 114x20 + 220x19 + 77x18 + 67x17 + 64x16 + 236x15 + 17x14 + 236x13 + 17x12 + 236x11 + 17x10

The lead term of the generator polynomial should also have the same exponent, so multiply by x15 to get

α0x25 + α251x24 + α67x23 + α46x22 + α61x21 + α118x20 + α70x19 + α64x18 + α94x17 + α32x16 + α45x15

Now it is possible to perform the repeated division steps. The number of steps in the division must equal the number of terms in the message polynomial. In this case, the division will take 16 steps to complete. This will result in a remainder that has 10 terms. These terms will be the 10 error correction codewords that are required.

Step 1a: Multiply the Generator Polynomial by the Lead Term of the Message Polynomial

The first step is to multiply the generator polynomial by the lead term of the message polynomial. The lead term in this case is 32x25. Since alpha notation makes it easier to perform the multiplication, it is recommended to convert 32x25 to alpha notation. According to the log antilog table, for the integer value 32, the alpha exponent is 5. Therefore 32 = α5. Multiply the generator polynomial by α5:

The exponents of the alphas are added together. In this case, at least one of the exponents is larger than 255, so perform modulo 255 as follows:

α5x25 + α(256 % 255)x24 + α72x23 + α51x22 + α66x21 + α123x20 + α75x19 + α69x18 + α99x17 + α37x16 + α50x15

The result is:

α5x25 + α1x24 + α72x23 + α51x22 + α66x21 + α123x20 + α75x19 + α69x18 + α99x17 + α37x16 + α50x15

Now, convert this to integer notation:

32x25 + 2x24 + 101x23 + 10x22 + 97x21 + 197x20 + 15x19 + 47x18 + 134x17 + 74x16 + 5x15

Step 1b: XOR the result with the message polynomial

Since this is the first division step, XOR the result from 1a with the message polynomial.

(32 ⊕ 32)x25 + (91 ⊕ 2)x24 + (11 ⊕ 101)x23 + (120 ⊕ 10)x22 + (209 ⊕ 97)x21 + (114 ⊕ 197)x20 + (220 ⊕ 15)x19 + (77 ⊕ 47)x18 + (67 ⊕ 134)x17 + (64 ⊕ 74)x16 + (236 ⊕ 5)x15 + (17 ⊕ 0)x14 + (236 ⊕ 0)x13 + (17 ⊕ 0)x12 + (236 ⊕ 0)x11 + (17 ⊕ 0)x10

The result is:

0x25 + 89x24 + 110x23 + 114x22 + 176x21 + 183x20 + 211x19 + 98x18 + 197x17 + 10x16 + 233x15 + 17x14 + 236x13 + 17x12 + 236x11 + 17x10

Discard the lead 0 term to get:

89x24 + 110x23 + 114x22 + 176x21 + 183x20 + 211x19 + 98x18 + 197x17 + 10x16 + 233x15 + 17x14 + 236x13 + 17x12 + 236x11 + 17x10

Step 2a: Multiply the Generator Polynomial by the Lead Term of the XOR result from the previous step

Next, multiply the generator polynomial by the lead term of the XOR result from the previous step. The lead term in this case is 89x24. Convert 89x24 to alpha notation. According to the log antilog table, for the integer value 89, the alpha exponent is 210. Therefore 89 = α210. Multiply the generator polynomial by α210:

210 * α0)x24 + (α210 * α251)x23 + (α210 * α67)x22 + (α210 * α46)x21 + (α210 * α61)x20 + (α210 * α118)x19 + (α210 * α70)x18 + (α210 * α64)x17 + (α210 * α94)x16 + (α210 * α32)x15 + (α210 * α45)x14

The exponents of the alphas are added together. In this case, at least one of the exponents is larger than 255, so perform modulo 255 as follows:

α210x24 + α(461 % 255)x23 + α(277 % 255)x22 + α(256 % 255)x21 + α(271 % 255)x20 + α(328 % 255)x19 + α(280 % 255)x18 + α(274 % 255)x17 + α(304 % 255)x16 + α242x15 + α255x14

The result is:

α210x24 + α206x23 + α22x22 + α1x21 + α16x20 + α73x19 + α25x18 + α19x17 + α49x16 + α242x15 + α0x14

Now, convert this to integer notation:

89x24 + 83x23 + 234x22 + 2x21 + 76x20 + 202x19 + 3x18 + 90x17 + 140x16 + 176x15 + 1x14

Step 2b: XOR the result with the result from step 1b

Use the result from step 1b to perform the next XOR.

(89 ⊕ 89)x24 + (110 ⊕ 83)x23 + (114 ⊕ 234)x22 + (176 ⊕ 2)x21 + (183 ⊕ 76)x20 + (211 ⊕ 202)x19 + (98 ⊕ 3)x18 + (197 ⊕ 90)x17 + (10 ⊕ 140)x16 + (233 ⊕ 176)x15 + (17 ⊕ 1)x14 + (236 ⊕ 0)x13 + (17 ⊕ 0)x12 + (236 ⊕ 0)x11 + (17 ⊕ 0)x10

The result is:

0x24 + 61x23 + 152x22 + 178x21 + 251x20 + 25x19 + 97x18 + 159x17 + 134x16 + 89x15 + 16x14 + 236x13 + 17x12 + 236x11 + 17x10

Discard the lead 0 term to get:

61x23 + 152x22 + 178x21 + 251x20 + 25x19 + 97x18 + 159x17 + 134x16 + 89x15 + 16x14 + 236x13 + 17x12 + 236x11 + 17x10

Step 3a: Multiply the Generator Polynomial by the Lead Term of the XOR result from the previous step

Next, multiply the generator polynomial by the lead term of the XOR result from the previous step. The lead term in this case is 61x23. Convert 61x23 to alpha notation. According to the log antilog table, for the integer value 61, the alpha exponent is 228. Therefore 61 = α228. Multiply the generator polynomial by α228:

228 * α0)x23 + (α228 * α251)x22 + (α228 * α67)x21 + (α228 * α46)x20 + (α228 * α61)x19 + (α228 * α118)x18 + (α228 * α70)x17 + (α228 * α64)x16 + (α228 * α94)x15 + (α228 * α32)x14 + (α228 * α45)x13

The exponents of the alphas are added together. In this case, at least one of the exponents is larger than 255, so perform modulo 255 as follows:

α228x23 + α(479 % 255)x22 + α(295 % 255)x21 + α(274 % 255)x20 + α(289 % 255)x19 + α(346 % 255)x18 + α(298 % 255)x17 + α(292 % 255)x16 + α(322 % 255)x15 + α(260 % 255)x14 + α(273 % 255)x13

The result is:

α228x23 + α224x22 + α40x21 + α19x20 + α34x19 + α91x18 + α43x17 + α37x16 + α67x15 + α5x14 + α18x13

Now, convert this to integer notation:

61x23 + 18x22 + 106x21 + 90x20 + 78x19 + 163x18 + 119x17 + 74x16 + 194x15 + 32x14 + 45x13

Step 3b: XOR the result with the result from step 2b

Use the result from step 2b to perform the next XOR.

(61 ⊕ 61)x23 + (152 ⊕ 18)x22 + (178 ⊕ 106)x21 + (251 ⊕ 90)x20 + (25 ⊕ 78)x19 + (97 ⊕ 163)x18 + (159 ⊕ 119)x17 + (134 ⊕ 74)x16 + (89 ⊕ 194)x15 + (16 ⊕ 32)x14 + (236 ⊕ 45)x13 + (17 ⊕ 0)x12 + (236 ⊕ 0)x11 + (17 ⊕ 0)x10

The result is:

0x23 + 138x22 + 216x21 + 161x20 + 87x19 + 194x18 + 232x17 + 204x16 + 155x15 + 48x14 + 193x13 + 17x12 + 236x11 + 17x10

Discard the lead 0 term to get:

138x22 + 216x21 + 161x20 + 87x19 + 194x18 + 232x17 + 204x16 + 155x15 + 48x14 + 193x13 + 17x12 + 236x11 + 17x10

Step 4a: Multiply the Generator Polynomial by the Lead Term of the XOR result from the previous step

Next, multiply the generator polynomial by the lead term of the XOR result from the previous step. The lead term in this case is 138x22. Convert 138x22 to alpha notation. According to the log antilog table, for the integer value 138, the alpha exponent is 222. Therefore 138 = α222. Multiply the generator polynomial by α222:

222 * α0)x22 + (α222 * α251)x21 + (α222 * α67)x20 + (α222 * α46)x19 + (α222 * α61)x18 + (α222 * α118)x17 + (α222 * α70)x16 + (α222 * α64)x15 + (α222 * α94)x14 + (α222 * α32)x13 + (α222 * α45)x12

The exponents of the alphas are added together. In this case, at least one of the exponents is larger than 255, so perform modulo 255 as follows:

α222x22 + α(473 % 255)x21 + α(289 % 255)x20 + α(268 % 255)x19 + α(283 % 255)x18 + α(340 % 255)x17 + α(292 % 255)x16 + α(286 % 255)x15 + α(316 % 255)x14 + α254x13 + α(267 % 255)x12

The result is:

α222x22 + α218x21 + α34x20 + α13x19 + α28x18 + α85x17 + α37x16 + α31x15 + α61x14 + α254x13 + α12x12

Now, convert this to integer notation:

138x22 + 43x21 + 78x20 + 135x19 + 24x18 + 214x17 + 74x16 + 192x15 + 111x14 + 142x13 + 205x12

Step 4b: XOR the result with the result from step 3b

Use the result from step 3b to perform the next XOR.

(138 ⊕ 138)x22 + (216 ⊕ 43)x21 + (161 ⊕ 78)x20 + (87 ⊕ 135)x19 + (194 ⊕ 24)x18 + (232 ⊕ 214)x17 + (204 ⊕ 74)x16 + (155 ⊕ 192)x15 + (48 ⊕ 111)x14 + (193 ⊕ 142)x13 + (17 ⊕ 205)x12 + (236 ⊕ 0)x11 + (17 ⊕ 0)x10

The result is:

0x22 + 243x21 + 239x20 + 208x19 + 218x18 + 62x17 + 134x16 + 91x15 + 95x14 + 79x13 + 220x12 + 236x11 + 17x10

Discard the lead 0 term to get:

243x21 + 239x20 + 208x19 + 218x18 + 62x17 + 134x16 + 91x15 + 95x14 + 79x13 + 220x12 + 236x11 + 17x10

Step 5a: Multiply the Generator Polynomial by the Lead Term of the XOR result from the previous step

Next, multiply the generator polynomial by the lead term of the XOR result from the previous step. The lead term in this case is 243x21. Convert 243x21 to alpha notation. According to the log antilog table, for the integer value 243, the alpha exponent is 233. Therefore 243 = α233. Multiply the generator polynomial by α233:

233 * α0)x21 + (α233 * α251)x20 + (α233 * α67)x19 + (α233 * α46)x18 + (α233 * α61)x17 + (α233 * α118)x16 + (α233 * α70)x15 + (α233 * α64)x14 + (α233 * α94)x13 + (α233 * α32)x12 + (α233 * α45)x11

The exponents of the alphas are added together. In this case, at least one of the exponents is larger than 255, so perform modulo 255 as follows:

α233x21 + α(484 % 255)x20 + α(300 % 255)x19 + α(279 % 255)x18 + α(294 % 255)x17 + α(351 % 255)x16 + α(303 % 255)x15 + α(297 % 255)x14 + α(327 % 255)x13 + α(265 % 255)x12 + α(278 % 255)x11

The result is:

α233x21 + α229x20 + α45x19 + α24x18 + α39x17 + α96x16 + α48x15 + α42x14 + α72x13 + α10x12 + α23x11

Now, convert this to integer notation:

243x21 + 122x20 + 193x19 + 143x18 + 53x17 + 217x16 + 70x15 + 181x14 + 101x13 + 116x12 + 201x11

Step 5b: XOR the result with the result from step 4b

Use the result from step 4b to perform the next XOR.

(243 ⊕ 243)x21 + (239 ⊕ 122)x20 + (208 ⊕ 193)x19 + (218 ⊕ 143)x18 + (62 ⊕ 53)x17 + (134 ⊕ 217)x16 + (91 ⊕ 70)x15 + (95 ⊕ 181)x14 + (79 ⊕ 101)x13 + (220 ⊕ 116)x12 + (236 ⊕ 201)x11 + (17 ⊕ 0)x10

The result is:

0x21 + 149x20 + 17x19 + 85x18 + 11x17 + 95x16 + 29x15 + 234x14 + 42x13 + 168x12 + 37x11 + 17x10

Discard the lead 0 term to get:

149x20 + 17x19 + 85x18 + 11x17 + 95x16 + 29x15 + 234x14 + 42x13 + 168x12 + 37x11 + 17x10

Step 6a: Multiply the Generator Polynomial by the Lead Term of the XOR result from the previous step

Next, multiply the generator polynomial by the lead term of the XOR result from the previous step. The lead term in this case is 149x20. Convert 149x20 to alpha notation. According to the log antilog table, for the integer value 149, the alpha exponent is 184. Therefore 149 = α184. Multiply the generator polynomial by α184:

184 * α0)x20 + (α184 * α251)x19 + (α184 * α67)x18 + (α184 * α46)x17 + (α184 * α61)x16 + (α184 * α118)x15 + (α184 * α70)x14 + (α184 * α64)x13 + (α184 * α94)x12 + (α184 * α32)x11 + (α184 * α45)x10

The exponents of the alphas are added together. In this case, at least one of the exponents is larger than 255, so perform modulo 255 as follows:

α184x20 + α(435 % 255)x19 + α251x18 + α230x17 + α245x16 + α(302 % 255)x15 + α254x14 + α248x13 + α(278 % 255)x12 + α216x11 + α229x10

The result is:

α184x20 + α180x19 + α251x18 + α230x17 + α245x16 + α47x15 + α254x14 + α248x13 + α23x12 + α216x11 + α229x10

Now, convert this to integer notation:

149x20 + 150x19 + 216x18 + 244x17 + 233x16 + 35x15 + 142x14 + 27x13 + 201x12 + 195x11 + 122x10

Step 6b: XOR the result with the result from step 5b

Use the result from step 5b to perform the next XOR.

(149 ⊕ 149)x20 + (17 ⊕ 150)x19 + (85 ⊕ 216)x18 + (11 ⊕ 244)x17 + (95 ⊕ 233)x16 + (29 ⊕ 35)x15 + (234 ⊕ 142)x14 + (42 ⊕ 27)x13 + (168 ⊕ 201)x12 + (37 ⊕ 195)x11 + (17 ⊕ 122)x10

The result is:

0x20 + 135x19 + 141x18 + 255x17 + 182x16 + 62x15 + 100x14 + 49x13 + 97x12 + 230x11 + 107x10

Discard the lead 0 term to get:

135x19 + 141x18 + 255x17 + 182x16 + 62x15 + 100x14 + 49x13 + 97x12 + 230x11 + 107x10

Step 7a: Multiply the Generator Polynomial by the Lead Term of the XOR result from the previous step

Next, multiply the generator polynomial by the lead term of the XOR result from the previous step. The lead term in this case is 135x19. Convert 135x19 to alpha notation. According to the log antilog table, for the integer value 135, the alpha exponent is 13. Therefore 135 = α13. Multiply the generator polynomial by α13:

13 * α0)x19 + (α13 * α251)x18 + (α13 * α67)x17 + (α13 * α46)x16 + (α13 * α61)x15 + (α13 * α118)x14 + (α13 * α70)x13 + (α13 * α64)x12 + (α13 * α94)x11 + (α13 * α32)x10 + (α13 * α45)x9

The exponents of the alphas are added together. In this case, at least one of the exponents is larger than 255, so perform modulo 255 as follows:

α13x19 + α(264 % 255)x18 + α80x17 + α59x16 + α74x15 + α131x14 + α83x13 + α77x12 + α107x11 + α45x10 + α58x9

The result is:

α13x19 + α9x18 + α80x17 + α59x16 + α74x15 + α131x14 + α83x13 + α77x12 + α107x11 + α45x10 + α58x9

Now, convert this to integer notation:

135x19 + 58x18 + 253x17 + 210x16 + 137x15 + 92x14 + 187x13 + 60x12 + 104x11 + 193x10 + 105x9

Step 7b: XOR the result with the result from step 6b

Use the result from step 6b to perform the next XOR.

(135 ⊕ 135)x19 + (141 ⊕ 58)x18 + (255 ⊕ 253)x17 + (182 ⊕ 210)x16 + (62 ⊕ 137)x15 + (100 ⊕ 92)x14 + (49 ⊕ 187)x13 + (97 ⊕ 60)x12 + (230 ⊕ 104)x11 + (107 ⊕ 193)x10 + (0 ⊕ 105)x9

The result is:

0x19 + 183x18 + 2x17 + 100x16 + 183x15 + 56x14 + 138x13 + 93x12 + 142x11 + 170x10 + 105x9

Discard the lead 0 term to get:

183x18 + 2x17 + 100x16 + 183x15 + 56x14 + 138x13 + 93x12 + 142x11 + 170x10 + 105x9

Step 8a: Multiply the Generator Polynomial by the Lead Term of the XOR result from the previous step

Next, multiply the generator polynomial by the lead term of the XOR result from the previous step. The lead term in this case is 183x18. Convert 183x18 to alpha notation. According to the log antilog table, for the integer value 183, the alpha exponent is 158. Therefore 183 = α158. Multiply the generator polynomial by α158:

158 * α0)x18 + (α158 * α251)x17 + (α158 * α67)x16 + (α158 * α46)x15 + (α158 * α61)x14 + (α158 * α118)x13 + (α158 * α70)x12 + (α158 * α64)x11 + (α158 * α94)x10 + (α158 * α32)x9 + (α158 * α45)x8

The exponents of the alphas are added together. In this case, at least one of the exponents is larger than 255, so perform modulo 255 as follows:

α158x18 + α(409 % 255)x17 + α225x16 + α204x15 + α219x14 + α(276 % 255)x13 + α228x12 + α222x11 + α252x10 + α190x9 + α203x8

The result is:

α158x18 + α154x17 + α225x16 + α204x15 + α219x14 + α21x13 + α228x12 + α222x11 + α252x10 + α190x9 + α203x8

Now, convert this to integer notation:

183x18 + 57x17 + 36x16 + 221x15 + 86x14 + 117x13 + 61x12 + 138x11 + 173x10 + 174x9 + 224x8

Step 8b: XOR the result with the result from step 7b

Use the result from step 7b to perform the next XOR.

(183 ⊕ 183)x18 + (2 ⊕ 57)x17 + (100 ⊕ 36)x16 + (183 ⊕ 221)x15 + (56 ⊕ 86)x14 + (138 ⊕ 117)x13 + (93 ⊕ 61)x12 + (142 ⊕ 138)x11 + (170 ⊕ 173)x10 + (105 ⊕ 174)x9 + (0 ⊕ 224)x8

The result is:

0x18 + 59x17 + 64x16 + 106x15 + 110x14 + 255x13 + 96x12 + 4x11 + 7x10 + 199x9 + 224x8

Discard the lead 0 term to get:

59x17 + 64x16 + 106x15 + 110x14 + 255x13 + 96x12 + 4x11 + 7x10 + 199x9 + 224x8

Step 9a: Multiply the Generator Polynomial by the Lead Term of the XOR result from the previous step

Next, multiply the generator polynomial by the lead term of the XOR result from the previous step. The lead term in this case is 59x17. Convert 59x17 to alpha notation. According to the log antilog table, for the integer value 59, the alpha exponent is 120. Therefore 59 = α120. Multiply the generator polynomial by α120:

120 * α0)x17 + (α120 * α251)x16 + (α120 * α67)x15 + (α120 * α46)x14 + (α120 * α61)x13 + (α120 * α118)x12 + (α120 * α70)x11 + (α120 * α64)x10 + (α120 * α94)x9 + (α120 * α32)x8 + (α120 * α45)x7

The exponents of the alphas are added together. In this case, at least one of the exponents is larger than 255, so perform modulo 255 as follows:

α120x17 + α(371 % 255)x16 + α187x15 + α166x14 + α181x13 + α238x12 + α190x11 + α184x10 + α214x9 + α152x8 + α165x7

The result is:

α120x17 + α116x16 + α187x15 + α166x14 + α181x13 + α238x12 + α190x11 + α184x10 + α214x9 + α152x8 + α165x7

Now, convert this to integer notation:

59x17 + 248x16 + 220x15 + 63x14 + 49x13 + 11x12 + 174x11 + 149x10 + 249x9 + 73x8 + 145x7

Step 9b: XOR the result with the result from step 8b

Use the result from step 8b to perform the next XOR.

(59 ⊕ 59)x17 + (64 ⊕ 248)x16 + (106 ⊕ 220)x15 + (110 ⊕ 63)x14 + (255 ⊕ 49)x13 + (96 ⊕ 11)x12 + (4 ⊕ 174)x11 + (7 ⊕ 149)x10 + (199 ⊕ 249)x9 + (224 ⊕ 73)x8 + (0 ⊕ 145)x7

The result is:

0x17 + 184x16 + 182x15 + 81x14 + 206x13 + 107x12 + 170x11 + 146x10 + 62x9 + 169x8 + 145x7

Discard the lead 0 term to get:

184x16 + 182x15 + 81x14 + 206x13 + 107x12 + 170x11 + 146x10 + 62x9 + 169x8 + 145x7

Step 10a: Multiply the Generator Polynomial by the Lead Term of the XOR result from the previous step

Next, multiply the generator polynomial by the lead term of the XOR result from the previous step. The lead term in this case is 184x16. Convert 184x16 to alpha notation. According to the log antilog table, for the integer value 184, the alpha exponent is 132. Therefore 184 = α132. Multiply the generator polynomial by α132:

132 * α0)x16 + (α132 * α251)x15 + (α132 * α67)x14 + (α132 * α46)x13 + (α132 * α61)x12 + (α132 * α118)x11 + (α132 * α70)x10 + (α132 * α64)x9 + (α132 * α94)x8 + (α132 * α32)x7 + (α132 * α45)x6

The exponents of the alphas are added together. In this case, at least one of the exponents is larger than 255, so perform modulo 255 as follows:

α132x16 + α(383 % 255)x15 + α199x14 + α178x13 + α193x12 + α250x11 + α202x10 + α196x9 + α226x8 + α164x7 + α177x6

The result is:

α132x16 + α128x15 + α199x14 + α178x13 + α193x12 + α250x11 + α202x10 + α196x9 + α226x8 + α164x7 + α177x6

Now, convert this to integer notation:

184x16 + 133x15 + 14x14 + 171x13 + 25x12 + 108x11 + 112x10 + 200x9 + 72x8 + 198x7 + 219x6

Step 10b: XOR the result with the result from step 9b

Use the result from step 9b to perform the next XOR.

(184 ⊕ 184)x16 + (182 ⊕ 133)x15 + (81 ⊕ 14)x14 + (206 ⊕ 171)x13 + (107 ⊕ 25)x12 + (170 ⊕ 108)x11 + (146 ⊕ 112)x10 + (62 ⊕ 200)x9 + (169 ⊕ 72)x8 + (145 ⊕ 198)x7 + (0 ⊕ 219)x6

The result is:

0x16 + 51x15 + 95x14 + 101x13 + 114x12 + 198x11 + 226x10 + 246x9 + 225x8 + 87x7 + 219x6

Discard the lead 0 term to get:

51x15 + 95x14 + 101x13 + 114x12 + 198x11 + 226x10 + 246x9 + 225x8 + 87x7 + 219x6

Step 11a: Multiply the Generator Polynomial by the Lead Term of the XOR result from the previous step

Next, multiply the generator polynomial by the lead term of the XOR result from the previous step. The lead term in this case is 51x15. Convert 51x15 to alpha notation. According to the log antilog table, for the integer value 51, the alpha exponent is 125. Therefore 51 = α125. Multiply the generator polynomial by α125:

125 * α0)x15 + (α125 * α251)x14 + (α125 * α67)x13 + (α125 * α46)x12 + (α125 * α61)x11 + (α125 * α118)x10 + (α125 * α70)x9 + (α125 * α64)x8 + (α125 * α94)x7 + (α125 * α32)x6 + (α125 * α45)x5

The exponents of the alphas are added together. In this case, at least one of the exponents is larger than 255, so perform modulo 255 as follows:

α125x15 + α(376 % 255)x14 + α192x13 + α171x12 + α186x11 + α243x10 + α195x9 + α189x8 + α219x7 + α157x6 + α170x5

The result is:

α125x15 + α121x14 + α192x13 + α171x12 + α186x11 + α243x10 + α195x9 + α189x8 + α219x7 + α157x6 + α170x5

Now, convert this to integer notation:

51x15 + 118x14 + 130x13 + 179x12 + 110x11 + 125x10 + 100x9 + 87x8 + 86x7 + 213x6 + 215x5

Step 11b: XOR the result with the result from step 10b

Use the result from step 10b to perform the next XOR.

(51 ⊕ 51)x15 + (95 ⊕ 118)x14 + (101 ⊕ 130)x13 + (114 ⊕ 179)x12 + (198 ⊕ 110)x11 + (226 ⊕ 125)x10 + (246 ⊕ 100)x9 + (225 ⊕ 87)x8 + (87 ⊕ 86)x7 + (219 ⊕ 213)x6 + (0 ⊕ 215)x5

The result is:

0x15 + 41x14 + 231x13 + 193x12 + 168x11 + 159x10 + 146x9 + 182x8 + 1x7 + 14x6 + 215x5

Discard the lead 0 term to get:

41x14 + 231x13 + 193x12 + 168x11 + 159x10 + 146x9 + 182x8 + 1x7 + 14x6 + 215x5

Step 12a: Multiply the Generator Polynomial by the Lead Term of the XOR result from the previous step

Next, multiply the generator polynomial by the lead term of the XOR result from the previous step. The lead term in this case is 41x14. Convert 41x14 to alpha notation. According to the log antilog table, for the integer value 41, the alpha exponent is 147. Therefore 41 = α147. Multiply the generator polynomial by α147:

147 * α0)x14 + (α147 * α251)x13 + (α147 * α67)x12 + (α147 * α46)x11 + (α147 * α61)x10 + (α147 * α118)x9 + (α147 * α70)x8 + (α147 * α64)x7 + (α147 * α94)x6 + (α147 * α32)x5 + (α147 * α45)x4

The exponents of the alphas are added together. In this case, at least one of the exponents is larger than 255, so perform modulo 255 as follows:

α147x14 + α(398 % 255)x13 + α214x12 + α193x11 + α208x10 + α(265 % 255)x9 + α217x8 + α211x7 + α241x6 + α179x5 + α192x4

The result is:

α147x14 + α143x13 + α214x12 + α193x11 + α208x10 + α10x9 + α217x8 + α211x7 + α241x6 + α179x5 + α192x4

Now, convert this to integer notation:

41x14 + 84x13 + 249x12 + 25x11 + 81x10 + 116x9 + 155x8 + 178x7 + 88x6 + 75x5 + 130x4

Step 12b: XOR the result with the result from step 11b

Use the result from step 11b to perform the next XOR.

(41 ⊕ 41)x14 + (231 ⊕ 84)x13 + (193 ⊕ 249)x12 + (168 ⊕ 25)x11 + (159 ⊕ 81)x10 + (146 ⊕ 116)x9 + (182 ⊕ 155)x8 + (1 ⊕ 178)x7 + (14 ⊕ 88)x6 + (215 ⊕ 75)x5 + (0 ⊕ 130)x4

The result is:

0x14 + 179x13 + 56x12 + 177x11 + 206x10 + 230x9 + 45x8 + 179x7 + 86x6 + 156x5 + 130x4

Discard the lead 0 term to get:

179x13 + 56x12 + 177x11 + 206x10 + 230x9 + 45x8 + 179x7 + 86x6 + 156x5 + 130x4

Step 13a: Multiply the Generator Polynomial by the Lead Term of the XOR result from the previous step

Next, multiply the generator polynomial by the lead term of the XOR result from the previous step. The lead term in this case is 179x13. Convert 179x13 to alpha notation. According to the log antilog table, for the integer value 179, the alpha exponent is 171. Therefore 179 = α171. Multiply the generator polynomial by α171:

171 * α0)x13 + (α171 * α251)x12 + (α171 * α67)x11 + (α171 * α46)x10 + (α171 * α61)x9 + (α171 * α118)x8 + (α171 * α70)x7 + (α171 * α64)x6 + (α171 * α94)x5 + (α171 * α32)x4 + (α171 * α45)x3

The exponents of the alphas are added together. In this case, at least one of the exponents is larger than 255, so perform modulo 255 as follows:

α171x13 + α(422 % 255)x12 + α238x11 + α217x10 + α232x9 + α(289 % 255)x8 + α241x7 + α235x6 + α(265 % 255)x5 + α203x4 + α216x3

The result is:

α171x13 + α167x12 + α238x11 + α217x10 + α232x9 + α34x8 + α241x7 + α235x6 + α10x5 + α203x4 + α216x3

Now, convert this to integer notation:

179x13 + 126x12 + 11x11 + 155x10 + 247x9 + 78x8 + 88x7 + 235x6 + 116x5 + 224x4 + 195x3

Step 13b: XOR the result with the result from step 12b

Use the result from step 12b to perform the next XOR.

(179 ⊕ 179)x13 + (56 ⊕ 126)x12 + (177 ⊕ 11)x11 + (206 ⊕ 155)x10 + (230 ⊕ 247)x9 + (45 ⊕ 78)x8 + (179 ⊕ 88)x7 + (86 ⊕ 235)x6 + (156 ⊕ 116)x5 + (130 ⊕ 224)x4 + (0 ⊕ 195)x3

The result is:

0x13 + 70x12 + 186x11 + 85x10 + 17x9 + 99x8 + 235x7 + 189x6 + 232x5 + 98x4 + 195x3

Discard the lead 0 term to get:

70x12 + 186x11 + 85x10 + 17x9 + 99x8 + 235x7 + 189x6 + 232x5 + 98x4 + 195x3

Step 14a: Multiply the Generator Polynomial by the Lead Term of the XOR result from the previous step

Next, multiply the generator polynomial by the lead term of the XOR result from the previous step. The lead term in this case is 70x12. Convert 70x12 to alpha notation. According to the log antilog table, for the integer value 70, the alpha exponent is 48. Therefore 70 = α48. Multiply the generator polynomial by α48:

48 * α0)x12 + (α48 * α251)x11 + (α48 * α67)x10 + (α48 * α46)x9 + (α48 * α61)x8 + (α48 * α118)x7 + (α48 * α70)x6 + (α48 * α64)x5 + (α48 * α94)x4 + (α48 * α32)x3 + (α48 * α45)x2

The exponents of the alphas are added together. In this case, at least one of the exponents is larger than 255, so perform modulo 255 as follows:

α48x12 + α(299 % 255)x11 + α115x10 + α94x9 + α109x8 + α166x7 + α118x6 + α112x5 + α142x4 + α80x3 + α93x2

The result is:

α48x12 + α44x11 + α115x10 + α94x9 + α109x8 + α166x7 + α118x6 + α112x5 + α142x4 + α80x3 + α93x2

Now, convert this to integer notation:

70x12 + 238x11 + 124x10 + 113x9 + 189x8 + 63x7 + 199x6 + 129x5 + 42x4 + 253x3 + 182x2

Step 14b: XOR the result with the result from step 13b

Use the result from step 13b to perform the next XOR.

(70 ⊕ 70)x12 + (186 ⊕ 238)x11 + (85 ⊕ 124)x10 + (17 ⊕ 113)x9 + (99 ⊕ 189)x8 + (235 ⊕ 63)x7 + (189 ⊕ 199)x6 + (232 ⊕ 129)x5 + (98 ⊕ 42)x4 + (195 ⊕ 253)x3 + (0 ⊕ 182)x2

The result is:

0x12 + 84x11 + 41x10 + 96x9 + 222x8 + 212x7 + 122x6 + 105x5 + 72x4 + 62x3 + 182x2

Discard the lead 0 term to get:

84x11 + 41x10 + 96x9 + 222x8 + 212x7 + 122x6 + 105x5 + 72x4 + 62x3 + 182x2

Step 15a: Multiply the Generator Polynomial by the Lead Term of the XOR result from the previous step

Next, multiply the generator polynomial by the lead term of the XOR result from the previous step. The lead term in this case is 84x11. Convert 84x11 to alpha notation. According to the log antilog table, for the integer value 84, the alpha exponent is 143. Therefore 84 = α143. Multiply the generator polynomial by α143:

143 * α0)x11 + (α143 * α251)x10 + (α143 * α67)x9 + (α143 * α46)x8 + (α143 * α61)x7 + (α143 * α118)x6 + (α143 * α70)x5 + (α143 * α64)x4 + (α143 * α94)x3 + (α143 * α32)x2 + (α143 * α45)x1

The exponents of the alphas are added together. In this case, at least one of the exponents is larger than 255, so perform modulo 255 as follows:

α143x11 + α(394 % 255)x10 + α210x9 + α189x8 + α204x7 + α(261 % 255)x6 + α213x5 + α207x4 + α237x3 + α175x2 + α188x1

The result is:

α143x11 + α139x10 + α210x9 + α189x8 + α204x7 + α6x6 + α213x5 + α207x4 + α237x3 + α175x2 + α188x1

Now, convert this to integer notation:

84x11 + 66x10 + 89x9 + 87x8 + 221x7 + 64x6 + 242x5 + 166x4 + 139x3 + 255x2 + 165x1

Step 15b: XOR the result with the result from step 14b

Use the result from step 14b to perform the next XOR.

(84 ⊕ 84)x11 + (41 ⊕ 66)x10 + (96 ⊕ 89)x9 + (222 ⊕ 87)x8 + (212 ⊕ 221)x7 + (122 ⊕ 64)x6 + (105 ⊕ 242)x5 + (72 ⊕ 166)x4 + (62 ⊕ 139)x3 + (182 ⊕ 255)x2 + (0 ⊕ 165)x1

The result is:

0x11 + 107x10 + 57x9 + 137x8 + 9x7 + 58x6 + 155x5 + 238x4 + 181x3 + 73x2 + 165x1

Discard the lead 0 term to get:

107x10 + 57x9 + 137x8 + 9x7 + 58x6 + 155x5 + 238x4 + 181x3 + 73x2 + 165x1

Step 16a: Multiply the Generator Polynomial by the Lead Term of the XOR result from the previous step

Next, multiply the generator polynomial by the lead term of the XOR result from the previous step. The lead term in this case is 107x10. Convert 107x10 to alpha notation. According to the log antilog table, for the integer value 107, the alpha exponent is 84. Therefore 107 = α84. Multiply the generator polynomial by α84:

84 * α0)x10 + (α84 * α251)x9 + (α84 * α67)x8 + (α84 * α46)x7 + (α84 * α61)x6 + (α84 * α118)x5 + (α84 * α70)x4 + (α84 * α64)x3 + (α84 * α94)x2 + (α84 * α32)x1 + (α84 * α45)x0

The exponents of the alphas are added together. In this case, at least one of the exponents is larger than 255, so perform modulo 255 as follows:

α84x10 + α(335 % 255)x9 + α151x8 + α130x7 + α145x6 + α202x5 + α154x4 + α148x3 + α178x2 + α116x1 + α129x0

The result is:

α84x10 + α80x9 + α151x8 + α130x7 + α145x6 + α202x5 + α154x4 + α148x3 + α178x2 + α116x1 + α129x0

Now, convert this to integer notation:

107x10 + 253x9 + 170x8 + 46x7 + 77x6 + 112x5 + 57x4 + 82x3 + 171x2 + 248x1 + 23

Step 16b: XOR the result with the result from step 15b

Use the result from step 15b to perform the next XOR.

(107 ⊕ 107)x10 + (57 ⊕ 253)x9 + (137 ⊕ 170)x8 + (9 ⊕ 46)x7 + (58 ⊕ 77)x6 + (155 ⊕ 112)x5 + (238 ⊕ 57)x4 + (181 ⊕ 82)x3 + (73 ⊕ 171)x2 + (165 ⊕ 248)x1 + (0 ⊕ 23)x0

The result is:

0x10 + 196x9 + 35x8 + 39x7 + 119x6 + 235x5 + 215x4 + 231x3 + 226x2 + 93x1 + 23

Discard the lead 0 term to get:

196x9 + 35x8 + 39x7 + 119x6 + 235x5 + 215x4 + 231x3 + 226x2 + 93x1 + 23

Use the terms of the remainder as the error correction codewords

The division has been performed 16 times, which is the number of terms in the message polynomial. This means that the division is complete and the terms of the above polynomial are the error correction codewords to use for the original message polynomial:

196  35  39  119  235  215  231  226  93  23

Next: Structure Final Message

The data codewords and error correction codewords have now been generated. For larger QR codes, the QR code specification requires that the codewords be interleaved according to a particular pattern. The next section, structure final message explains the interleaving process.