UNB ECE4253 Digital Communications
Department of Electrical and Computer Engineering - University of New Brunswick, Fredericton, NB, Canada

Polynomial Code Generator Tool

Given a generator polynomial G(x) of degree p and a binary input data size k, this online tool creates and displays a generator matrix G, a check matrix H, and a demonstration of the resulting systematic codewords for this (n,k) code, where n=p+k. The nature of G(x) and the value of k will determine the utility of the codewords in a error control scheme.

The mathematics of error control can be based on either a matrix or a polynomial approach. This page shows how any polynomial G(x) may be used to define an equivalent check matrix and generator matrix. Conversely, it is not always possible to find a polynomial G(x) corresponding to an arbitary generator matrix.

The generator polynomial G(x) can be up to degree p=36, and the input data size is limited to k=36 bits.


Polynomial G(x)

G(x) = x+1

(11)


Sample (8,7) Codewords  (cyclic)

DATA = 00 : 00000000
DATA = 01 : 00000011
DATA = 02 : 00000101
DATA = 03 : 00000110
DATA = 04 : 00001001
DATA = 05 : 00001010
DATA = 06 : 00001100
DATA = 07 : 00001111
DATA = 08 : 00010001
DATA = 09 : 00010010
DATA = 10 : 00010100
DATA = 11 : 00010111
DATA = 12 : 00011000
DATA = 13 : 00011011
DATA = 14 : 00011101
DATA = 15 : 00011110
DATA = 16 : 00100001
DATA = 17 : 00100010
DATA = 18 : 00100100
DATA = 19 : 00100111
DATA = 20 : 00101000
DATA = 21 : 00101011
DATA = 22 : 00101101
DATA = 23 : 00101110
DATA = 24 : 00110000
DATA = 25 : 00110011
DATA = 26 : 00110101
DATA = 27 : 00110110
DATA = 28 : 00111001
DATA = 29 : 00111010
DATA = 30 : 00111100
DATA = 31 : 00111111
DATA = 32 : 01000001
DATA = 33 : 01000010
DATA = 34 : 01000100
DATA = 35 : 01000111
DATA = 36 : 01001000
DATA = 37 : 01001011
DATA = 38 : 01001101
DATA = 39 : 01001110
DATA = 40 : 01010000
DATA = 41 : 01010011
DATA = 42 : 01010101
DATA = 43 : 01010110
DATA = 44 : 01011001
DATA = 45 : 01011010
DATA = 46 : 01011100
DATA = 47 : 01011111
DATA = 48 : 01100000
DATA = 49 : 01100011
DATA = 50 : 01100101
DATA = 51 : 01100110
DATA = 52 : 01101001
DATA = 53 : 01101010
DATA = 54 : 01101100
DATA = 55 : 01101111
DATA = 56 : 01110001
DATA = 57 : 01110010
DATA = 58 : 01110100
DATA = 59 : 01110111
DATA = 60 : 01111000
DATA = 61 : 01111011
DATA = 62 : 01111101
DATA = 63 : 01111110
← less


Distance Analysis

This sample subset of 8-bit codewords has a minimum distance D=2 and no error correction is possible. The codewords remain useful for single bit error detection.

 00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
00--020202020202040202020402040404020202040204040402040404040404060202020402040404020404040404040602040404040404060404040604060606
0102--0202020204020202040204020404020204020402040404020404040406040202040204020404040204040404060404020404040406040404060406040606
020202--02020402020204020204040204020402020404020404040204040604040204020204040204040402040406040404040204040604040406040406060406
03020202--040202020402020204040402040202020404040204040402060404040402020204040402040404020604040404040402060404040604040406060604
0402020204--0202020204040402020204020404040202020404040406020404040204040402020204040404060204040404040406020404040406060604040406
050202040202--02020402040402020402040204040202040204040604040204040402040402020402040406040402040404040604040204040604060604040604
06020402020202--020404020402040202040402040204020204060404040402040404020402040202040604040404020404060404040402040606040604060404
0704020202020202--0404040204020202040404020402020206040404040404020404040204020202060404040404040206040404040404020606060406040404
080202020402040404--02020202020204020404040404040602020204020404040204040404040406020202040204040404040406040606060204040404040406
09020204020402040402--020202020402040204040404060402020402040204040402040404040604020204020402040404040604060406060402040404040604
1002040202040402040202--0202040202040402040406040402040202040402040404020404060404020402020404020404060404060604060404020404060404
110402020204040402020202--04020202040404020604040404020202040404020404040206040404040202020404040206040404060606040404040206040404
12020404040202020402020204--020202040404060204040402040404020202040404040602040404020404040202020404060606040404060404040602040404
1304020404020204020202040202--0202040406040402040404020404020204020404060404020404040204040202040206040606040406040404060404020404
140404020402040202020402020202--02040604040404020404040204020402020406040404040204040402040204020206060406040604040406040404040204
15040404020402020204020202020202--060404040404040204040402040202020604040404040402040404020402020206060604060404040604040404040402
1602020204020404040204040404040406--0202020202020402020204020404040204040404040406040404060406060602020204020404040204040404040406
170202040204020404040204040404060402--02020202040202020402040204040402040404040604040406040604060602020402040204040402040404040604
18020402020404020404040204040604040202--020204020202040202040402040404020404060404040604040606040602040202040402040404020404060404
1904020202040404020404040206040404020202--0402020204020202040404020404040206040404060404040606060404020202040404020404040206040404
200204040402020204040404060204040402020204--02020202040404020202040404040602040404040606060404040602040404020202040404040602040404
21040204040202040204040604040204040202040202--020204020404020204020404060404020404060406060404060404020404020204020404060404020404
2204040204020402020406040404040204020402020202--0204040204020402020406040404040204060604060406040404040204020402020406040404040204
230404040204020202060404040404040204020202020202--04040402040202020604040404040402060606040604040404040402040202020604040404040402
24020404040404040602020204020404040202020402040404--020202020202040404040604060606020404040404040602040404040404060202020402040404
2504020404040406040202040204020404020204020402040402--0202020204020404060406040606040204040404060404020404040406040202040204020404
260404020404060404020402020404020402040202040402040202--02020402020406040406060406040402040406040404040204040604040204020204040204
27040404020604040404020202040404020402020204040402020202--040202020604040406060604040404020604040404040402060404040402020204040402
2804040406020404040204040402020204020404040202020402020204--0202020406060604040406040404060204040404040406020404040204040402020204
290404060404020404040204040202040204020404020204020202040202--02020604060604040604040406040402040404040604040204040402040402020402
30040604040404020404040204020402020404020402040202020402020202--020606040604060404040604040404020404060404040402040404020402040202
3106040404040404020404040204020202040404020402020204020202020202--0606060406040404060404040404040206040404040404020404040204020202
320202020402040404020404040404040602040404040404060404040604060606--02020202020204020202040204040402020204020404040204040404040406
33020204020402040404020404040406040402040404040604040406040604060602--020202020402020204020402040402020402040204040402040404040604
3402040202040402040404020404060404040402040406040404060404060604060202--0202040202020402020404020402040202040402040404020404060404
350402020204040402040404020604040404040402060404040604040406060604020202--04020202040202020404040204020202040404020404040206040404
36020404040202020404040406020404040404040602040404040606060404040602020204--020202020404040202020402040404020202040404040602040404
3704020404020204020404060404020404040406040402040406040606040406040202040202--0202040204040202040204020404020204020404060404020404
380404020402040202040604040404020404060404040402040606040604060404020402020202--02040402040204020204040204020402020406040404040204
39040404020402020206040404040404020604040404040402060606040604040404020202020202--040404020402020204040402040202020604040404040402
4002040404040404060202020402040404040404060406060602040404040404060202020402040404--0202020202020402040404040404060202020402040404
410402040404040604020204020402040404040604060406060402040404040604020204020402040402--02020202040204020404040406040202040204020404
42040402040406040402040202040402040406040406060406040402040406040402040202040402040202--020204020204040204040604040204020204040204
4304040402060404040402020204040402060404040606060404040402060404040402020204040402020202--0402020204040402060404040402020204040402
440404040602040404020404040202020404060606040404060404040602040404020404040202020402020204--02020204040406020404040204040402020204
45040406040402040404020404020204020604060604040604040406040402040404020404020204020202040202--020204040604040204040402040402020402
4604060404040402040404020402040202060604060406040404060404040402040404020402040202020402020202--0204060404040402040404020402040202
470604040404040402040404020402020206060604060404040604040404040402040404020402020204020202020202--06040404040404020404040204020202
48020404040404040604040406040606060202020402040404020404040404040602020204020404040204040404040406--020202020202040202020402040404
4904020404040406040404060406040606020204020402040404020404040406040202040204020404040204040404060402--0202020204020202040204020404
500404020404060404040604040606040602040202040402040404020404060404020402020404020404040204040604040202--02020402020204020204040204
51040404020604040406040404060606040402020204040402040404020604040404020202040404020404040206040404020202--040202020402020204040402
5204040406020404040406060604040406020404040202020404040406020404040204040402020204040404060204040402020204--0202020204040402020204
530404060404020404060406060404060404020404020204020404060404020404040204040202040204040604040204040202040202--02020402040402020402
54040604040404020406060406040604040404020402040202040604040404020404040204020402020406040404040204020402020202--020404020402040202
5506040404040404020606060406040404040404020402020206040404040404020404040204020202060404040404040204020202020202--0404040204020202
560404040604060606020404040404040602040404040404060202020402040404020404040404040602020204020404040202020402040404--02020202020204
57040406040604060604020404040406040402040404040604020204020402040404020404040406040202040204020404020204020402040402--020202020402
5804060404060604060404020404060404040402040406040402040202040402040404020404060404020402020404020402040202040402040202--0202040202
590604040406060604040404020604040404040402060404040402020204040402040404020604040404020202040404020402020204040402020202--04020202
60040606060404040604040406020404040404040602040404020404040202020404040406020404040204040402020204020404040202020402020204--020202
6106040606040406040404060404020404040406040402040404020404020204020404060404020404040204040202040204020404020204020202040202--0202
620606040604060404040604040404020404060404040402040404020402040202040604040404020404040204020402020404020402040202020402020202--02
63060606040604040406040404040404020604040404040402040404020402020206040404040404020404040204020202040404020402020204020202020202--

This sampling of 64 codewords is not necessarily indicative of the error control performance of all 27 = 128 possible codewords.



Specify a new polynomial or a different number of data bits.

Model M20J GENERATOR POLYNOMIAL TOOL
Data Bits k =   G(x):

Discussion Codewords Generator Format
G = [Ik|P]
G = [P|Ik]
MATLAB Matrices

Examples

  1. (8,7) Simple Parity Bit (D=2) no error correction

  2. (7,4) Hamming Code (D=3) single bit error correction

  3. (15,11) Hamming Code (D=3) single bit error correction

  4. (15,10) Extended Hamming Code (D=4) single bit error correction

  5. (31,21) BCH Code (D=5) double bit error correction (notes)

  6. (15,5) BCH Code (D=7) triple bit error correction (notes)

  7. (23,12,7) Binary Golay Code (D=7) triple bit error correction

  8. (35,27) Fire Code specialized 3-bit burst error correction

  9. 16-bit CRC (CCITT) commonly used for error detection (notes)


2025-07-01 06:10:28 ADT
Last Updated: 2015-02-06
Richard Tervo [ tervo@unb.ca ] Back to the course homepage...