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) = x10+x9+x8+x6+x5+x3+1

(11101101001)


Sample (31,21) Codewords  (cyclic)

DATA = 00 : 0000000000000000000000000000000
DATA = 01 : 0000000000000000000011101101001
DATA = 02 : 0000000000000000000100110111011
DATA = 03 : 0000000000000000000111011010010
DATA = 04 : 0000000000000000001001101110110
DATA = 05 : 0000000000000000001010000011111
DATA = 06 : 0000000000000000001101011001101
DATA = 07 : 0000000000000000001110110100100
DATA = 08 : 0000000000000000010000110000101
DATA = 09 : 0000000000000000010011011101100
DATA = 10 : 0000000000000000010100000111110
DATA = 11 : 0000000000000000010111101010111
DATA = 12 : 0000000000000000011001011110011
DATA = 13 : 0000000000000000011010110011010
DATA = 14 : 0000000000000000011101101001000
DATA = 15 : 0000000000000000011110000100001
DATA = 16 : 0000000000000000100001100001010
DATA = 17 : 0000000000000000100010001100011
DATA = 18 : 0000000000000000100101010110001
DATA = 19 : 0000000000000000100110111011000
DATA = 20 : 0000000000000000101000001111100
DATA = 21 : 0000000000000000101011100010101
DATA = 22 : 0000000000000000101100111000111
DATA = 23 : 0000000000000000101111010101110
DATA = 24 : 0000000000000000110001010001111
DATA = 25 : 0000000000000000110010111100110
DATA = 26 : 0000000000000000110101100110100
DATA = 27 : 0000000000000000110110001011101
DATA = 28 : 0000000000000000111000111111001
DATA = 29 : 0000000000000000111011010010000
DATA = 30 : 0000000000000000111100001000010
DATA = 31 : 0000000000000000111111100101011
DATA = 32 : 0000000000000001000000101111101
DATA = 33 : 0000000000000001000011000010100
DATA = 34 : 0000000000000001000100011000110
DATA = 35 : 0000000000000001000111110101111
DATA = 36 : 0000000000000001001001000001011
DATA = 37 : 0000000000000001001010101100010
DATA = 38 : 0000000000000001001101110110000
DATA = 39 : 0000000000000001001110011011001
DATA = 40 : 0000000000000001010000011111000
DATA = 41 : 0000000000000001010011110010001
DATA = 42 : 0000000000000001010100101000011
DATA = 43 : 0000000000000001010111000101010
DATA = 44 : 0000000000000001011001110001110
DATA = 45 : 0000000000000001011010011100111
DATA = 46 : 0000000000000001011101000110101
DATA = 47 : 0000000000000001011110101011100
DATA = 48 : 0000000000000001100001001110111
DATA = 49 : 0000000000000001100010100011110
DATA = 50 : 0000000000000001100101111001100
DATA = 51 : 0000000000000001100110010100101
DATA = 52 : 0000000000000001101000100000001
DATA = 53 : 0000000000000001101011001101000
DATA = 54 : 0000000000000001101100010111010
DATA = 55 : 0000000000000001101111111010011
DATA = 56 : 0000000000000001110001111110010
DATA = 57 : 0000000000000001110010010011011
DATA = 58 : 0000000000000001110101001001001
DATA = 59 : 0000000000000001110110100100000
DATA = 60 : 0000000000000001111000010000100
DATA = 61 : 0000000000000001111011111101101
DATA = 62 : 0000000000000001111100100111111
DATA = 63 : 0000000000000001111111001010110
← less


Distance Analysis

This sample subset of 31-bit codewords has a minimum distance D=5, correcting up to t=2 errors.

 00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
00--070807080708070508071009080706050607080708091008090809100706110805061106070809070807080910091009080908050809121009080706131211
0107--0708070807080805100708090607060508070807100909080908071011060508110607060908080708071009100908090809080512090910070813061112
020807--07080708070710050807060908070805060910070808090809061110070611080508090607070807080910091009080908091205080807100912110613
03070807--070807081007080506070809080706051009080709080908110607101106050809080706080708071009100908090809120908050708091011121306
0408070807--0708070908070605080710070809100506070810070611080908090607080908050611091009100708070805080912090809080613121110090807
050708070807--07080809060708051007080710090605080707101106090809080706090805081106100910090807080708051209080908091306111209100708
06080708070807--070706090807100508091007080708050606111007080908090809060706110805091009100708070809120508090809081211061308071009
0707080708070807--0607080910070805100908070807060511060710090809080908070611060508100910090807080712090805080908091112130607080910
080508071009080706--07080708070807080908091007061105060708070809100708070809100910080506110607080910090807061312110908090805080912
09080510070809060707--070807080708090809080710110606050807080710090807080710091009050811060706090809100708130611120809080908051209
1007100508070609080807--0708070807080908090611100707080506091007080708070809100910061108050809060708071009121106130908090809120508
111007080506070809070807--07080708090809081106071008070605100908070807080710091009110605080908070607080910111213060809080912090805
12090807060508071008070807--070807100706110809080907080910050607080910091007080708060708090805061106131211100908070508091209080908
1308090607080510070708070807--0708071011060908090808071009060508071009100908070807070609080508110613061112091007080805120908090809
140706090807100508080708070807--07061110070809080909100708070805060910091007080708080906070611080512110613080710090912050809080908
15060708091007080507080708070807--110607100908090810090807080706051009100908070807090807061106050811121306070809101209080508090809
1605060708070809100809080910070611--0708070807080705080710090807060908090805080912100908070613121108050611060708090708070809100910
170605080708071009090809080710110607--07080708070808051007080906070809080908051209091007081306111205081106070609080807080710091009
18070805060910070808090809061110070807--070807080707100508070609080908090809120508080710091211061306110805080906070708070809100910
1908070605100908070908090811060710070807--0708070810070805060708090809080912090805070809101112130611060508090807060807080710091009
200708091005060708100706110809080908070807--07080709080706050807100508091209080908061312111009080706070809080506110910091007080708
21080710090605080707101106090809080708070807--070808090607080510070805120908090809130611120910070807060908050811061009100908070807
2209100708070805060611100708090809080708070807--0707060908071005080912050809080908121106130807100908090607061108050910091007080708
231009080708070605110607100908090807080708070807--06070809100708051209080508090809111213060708091009080706110605081009100908070807
24080908091007061105060708070809100508071009080706--070807080708071009080706131211090809080508091207080708091009100805061106070809
2509080908071011060605080708071009080510070809060707--0708070807080910070813061112080908090805120908070807100910090508110607060908
260809080906111007070805060910070807100508070609080807--07080708070807100912110613090809080912050807080708091009100611080508090607
27090809081106071008070605100908071007080506070809070807--070807080708091011121306080908091209080508070807100910091106050809080706
2810070611080908090708091005060708090807060508071008070807--0708070613121110090807050809120908090809100910070807080607080908050611
290710110609080908080710090605080708090607080510070708070807--07081306111209100708080512090809080910091009080708070706090805081106
30061110070809080909100708070805060706090807100508080708070807--071211061308071009091205080908090809100910070807080809060706110805
3111060710090809081009080708070605060708091007080507080708070807--1112130607080910120908050809080910091009080708070908070611060508
320805061106070809070807080910091009080908050809121009080706131211--07080708070807050807100908070605060708070809100809080910070611
33050811060706090808070807100910090809080908051209091007081306111207--070807080708080510070809060706050807080710090908090807101106
3406110805080906070708070809100910090809080912050808071009121106130807--0708070807071005080706090807080506091007080809080906111007
351106050809080706080708071009100908090809120908050708091011121306070807--07080708100708050607080908070605100908070908090811060710
36060708090805061109100910070807080508091209080908061312111009080708070807--070807090807060508071007080910050607081007061108090809
3707060908050811061009100908070807080512090809080913061112091007080708070807--0708080906070805100708071009060508070710110609080908
380809060706110805091009100708070809120508090809081211061308071009080708070807--07070609080710050809100708070805060611100708090809
39090807061106050810091009080708071209080508090809111213060708091007080708070807--060708091007080510090807080706051106071009080908
4007080708091009100805061106070809100908070613121109080908050809120508071009080706--0708070807080708090809100706110506070807080910
410807080710091009050811060706090809100708130611120809080908051209080510070809060707--07080708070809080908071011060605080708071009
42070807080910091006110805080906070807100912110613090809080912050807100508070609080807--070807080708090809061110070708050609100708
4308070807100910091106050809080706070809101112130608090809120908051007080506070809070807--0708070809080908110607100807060510090807
440910091007080708060708090805061106131211100908070508091209080908090807060508071008070807--07080710070611080908090708091005060708
45100910090807080707060908050811061306111209100708080512090809080908090607080510070708070807--070807101106090809080807100906050807
4609100910070807080809060706110805121106130807100909120508090809080706090807100508080708070807--0706111007080908090910070807080506
471009100908070807090807061106050811121306070809101209080508090809060708091007080507080708070807--11060710090809081009080708070605
48090809080508091210090807061312110805061106070809070807080910091005060708070809100809080910070611--070807080708070508071009080706
4908090809080512090910070813061112050811060706090808070807100910090605080708071009090809080710110607--0708070807080805100708090607
500908090809120508080710091211061306110805080906070708070809100910070805060910070808090809061110070807--07080708070710050807060908
51080908091209080507080910111213061106050809080706080708071009100908070605100908070908090811060710070807--070807081007080506070809
5205080912090809080613121110090807060708090805061109100910070807080708091005060708100706110809080908070807--0708070908070605080710
530805120908090809130611120910070807060908050811061009100908070807080710090605080707101106090809080708070807--07080809060708051007
54091205080908090812110613080710090809060706110805091009100708070809100708070805060611100708090809080708070807--070706090807100508
5512090805080908091112130607080910090807061106050810091009080708071009080708070605110607100908090807080708070807--0607080910070805
561009080706131211090809080508091207080708091009100805061106070809080908091007061105060708070809100508071009080706--07080708070807
57091007081306111208090809080512090807080710091009050811060706090809080908071011060605080708071009080510070809060707--070807080708
5808071009121106130908090809120508070807080910091006110805080906070809080906111007070805060910070807100508070609080807--0708070807
590708091011121306080908091209080508070807100910091106050809080706090809081106071008070605100908071007080506070809070807--07080708
60061312111009080705080912090809080910091007080708060708090805061110070611080908090708091005060708090807060508071008070807--070807
6113061112091007080805120908090809100910090807080707060908050811060710110609080908080710090605080708090607080510070708070807--0708
621211061308071009091205080908090809100910070807080809060706110805061110070809080909100708070805060706090807100508080708070807--07
63111213060708091012090805080908091009100908070807090807061106050811060710090809081009080708070605060708091007080507080708070807--

This sampling of 64 codewords is not necessarily indicative of the error control performance of all 221 = 2097152 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-04 12:34:54 ADT
Last Updated: 2015-02-06
Richard Tervo [ tervo@unb.ca ] Back to the course homepage...