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) = x4+x+1

(10011)


Sample (15,11) Codewords  (cyclic)

DATA = 00 : 000000000000000
DATA = 01 : 000000000010011
DATA = 02 : 000000000100110
DATA = 03 : 000000000110101
DATA = 04 : 000000001001100
DATA = 05 : 000000001011111
DATA = 06 : 000000001101010
DATA = 07 : 000000001111001
DATA = 08 : 000000010001011
DATA = 09 : 000000010011000
DATA = 10 : 000000010101101
DATA = 11 : 000000010111110
DATA = 12 : 000000011000111
DATA = 13 : 000000011010100
DATA = 14 : 000000011100001
DATA = 15 : 000000011110010
DATA = 16 : 000000100000101
DATA = 17 : 000000100010110
DATA = 18 : 000000100100011
DATA = 19 : 000000100110000
DATA = 20 : 000000101001001
DATA = 21 : 000000101011010
DATA = 22 : 000000101101111
DATA = 23 : 000000101111100
DATA = 24 : 000000110001110
DATA = 25 : 000000110011101
DATA = 26 : 000000110101000
DATA = 27 : 000000110111011
DATA = 28 : 000000111000010
DATA = 29 : 000000111010001
DATA = 30 : 000000111100100
DATA = 31 : 000000111110111
DATA = 32 : 000001000001010
DATA = 33 : 000001000011001
DATA = 34 : 000001000101100
DATA = 35 : 000001000111111
DATA = 36 : 000001001000110
DATA = 37 : 000001001010101
DATA = 38 : 000001001100000
DATA = 39 : 000001001110011
DATA = 40 : 000001010000001
DATA = 41 : 000001010010010
DATA = 42 : 000001010100111
DATA = 43 : 000001010110100
DATA = 44 : 000001011001101
DATA = 45 : 000001011011110
DATA = 46 : 000001011101011
DATA = 47 : 000001011111000
DATA = 48 : 000001100001111
DATA = 49 : 000001100011100
DATA = 50 : 000001100101001
DATA = 51 : 000001100111010
DATA = 52 : 000001101000011
DATA = 53 : 000001101010000
DATA = 54 : 000001101100101
DATA = 55 : 000001101110110
DATA = 56 : 000001110000100
DATA = 57 : 000001110010111
DATA = 58 : 000001110100010
DATA = 59 : 000001110110001
DATA = 60 : 000001111001000
DATA = 61 : 000001111011011
DATA = 62 : 000001111101110
DATA = 63 : 000001111111101
← less


Distance Analysis

This sample subset of 15-bit codewords has a minimum distance D=3, correcting up to t=1 error.

 00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
00--030304030604050403050605040405030404030405070605060407040505080304040704050306030406050607070606050506050406070407050605080809
0103--0403060305040304060504050504040303040504060706050704050408050403070405040603040305060706060705060605040507060704060508050908
020304--03040503060506040304050504040303040706040504070506050804050407030403060405060503040706060705060605060705040506040708090508
03040303--050406030605030405040405030404030607050407040605080505040704040306030504050604030607070606050506070604050605070409080805
0403060405--0303040504040504030506040507060304040304050508050604070405030603040407060707060304060505040607060505060508080904070506
050603050403--04030405050403040605050406070403030405040805060507040504060304030704070606070403050604050706050606050805090807040605
06040503060304--030405050405060403070604050403030405080405040705060306040504070304070606070605030406070504050606050809050805060407
0705040603040303--0504040506050304060705040304040308050504070406050603050407040403060707060506040307060405060505060908080506050704
080403050605040405--03030403060405050604070405050803040403040507060304060506070706030404070405030604070506050808090605050605040607
09030406050405050403--040306030504060507040504080504030304050406070403050607060607040307040504060307040605080509080506060504050706
1005060403040505040304--0304050306040705060508040504030304070604050605030407060607040703040306040505060407080905080506060506070504
110605030405040405040303--05040603070406050805050403040403060705040506040306070706070404030603050406050704090808050605050607060405
12050404050403050603060405--030304040505080506040704050706030404030607070603040605040503060304040705080809040705060504060706050506
1304050504030406050603050403--0403050408050605070405040607040303040706060704030506050406030403070408050908070406050405070605060605
140405050405060403040503060304--03050804050407050607060405040303040706060706050304030604050407030408090508050604070607050405060605
15050404050605030405040603040303--080505040704060506070504030404030607070605060403060305040704040309080805060507040706040506050506
1603040403040507060506040704050508--0303040306040504030506050404050605050605040607040705060508080903040407040503060304060506070706
170403030405040607060507040504080503--04030603050403040605040505040506060504050706070406050805090804030704050406030403050607060607
18040303040706040504070506050804050304--030405030605060403040505040506060506070504050604070809050804070304030604050605030407060607
1903040403060705040704060508050504040303--0504060306050304050404050605050607060405060507040908080507040403060305040506040306070706
200405070603040403040505080506040703060405--03030405040405040305060504060706050506050808090407050604050306030404070607070603040605
21050406070403030405040805060507040603050403--040304050504030406050405070605060605080509080704060505040603040307040706060704030506
2207060405040303040508040504070506040503060304--0304050504050604030607050405060605080905080506040703060405040703040706060706050304
230607050403040403080505040704060505040603040303--05040405060503040706040506050506090808050605070406030504070404030607070605060403
24050604070405050803040403040507060403050605040405--030304030604050407050605080809060505060504060703040605060707060304040704050306
2506050704050408050403030405040607030406050405050403--0403060305040704060508050908050606050405070604030506070606070403070405040603
260407050605080405040303040706040505060403040505040304--03040503060506040708090508050606050607050406050304070606070407030403060405
27070406050805050403040403060705040605030405040405040303--050406030605070409080805060505060706040505060403060707060704040306030504
2804050508050604070405070603040403050404050403050603060405--0303040508080904070506050406070605050606070706030406050405030603040407
290504080506050704050406070403030404050504030406050603050403--04030805090807040605040507060506060507060607040305060504060304030704
30050804050407050607060405040303040405050405060403040503060304--030809050805060407060705040506060507060607060503040306040504070304
3108050504070406050607050403040403050404050605030405040603040303--0908080506050704070604050605050606070706050604030603050407040403
320304040704050306030406050607070606050506050406070407050605080809--03030403060405040305060504040503040403040507060506040704050508
33040307040504060304030506070606070506060504050706070406050805090803--040306030504030406050405050404030304050406070605070405040805
3404070304030604050605030407060607050606050607050405060407080905080304--0304050306050604030405050404030304070604050407050605080405
350704040306030504050604030607070606050506070604050605070409080805040303--05040603060503040504040503040403060705040704060508050504
36040503060304040706070706030406050504060706050506050808090407050603060405--030304050404050403050604050706030404030405050805060407
3705040603040307040706060704030506040507060506060508050908070406050603050403--0403040505040304060505040607040303040504080506050704
380306040504070304070606070605030406070504050606050809050805060407040503060304--03040505040506040307060405040303040508040504070506
39060305040704040306070706050604030706040506050506090808050605070405040603040303--050404050605030406070504030404030805050407040605
4003040605060707060304040704050306040705060508080906050506050406070403050605040405--0303040306040505060407040505080304040304050706
410403050607060607040307040504060307040605080509080506060504050706030406050405050403--04030603050406050704050408050403030405040607
42060503040706060704070304030604050506040708090508050606050607050405060403040505040304--030405030604070506050804050403030407060405
4305060403060707060704040306030504060507040908080506050506070604050605030405040405040303--0504060307040605080505040304040306070504
440607070603040605040503060304040705080809040705060504060706050506050404050403050603060405--03030404050508050604070405070603040403
45070606070403050605040603040307040805090807040605040507060506060504050504030406050603050403--040305040805060507040504060704030304
4607060607060503040306040504070304080905080506040706070504050606050405050405060403040503060304--0305080405040705060706040504030304
470607070605060403060305040704040309080805060507040706040506050506050404050605030405040603040303--08050504070406050607050403040403
48060505060504060704070506050808090304040704050306030406050607070603040403040507060506040704050508--030304030604050403050605040405
4905060605040507060704060508050908040307040504060304030506070606070403030405040607060507040504080503--0403060305040304060504050504
500506060506070504050604070809050804070304030604050605030407060607040303040706040504070506050804050304--03040503060506040304050504
51060505060706040506050704090808050704040306030504050604030607070603040403060705040704060508050504040303--050406030605030405040405
5205040607060505060508080904070506040503060304040706070706030406050405070603040403040505080506040703060405--0303040504040504030506
530405070605060605080509080704060505040603040307040706060704030506050406070403030405040805060507040603050403--04030405050403040605
54060705040506060508090508050604070306040504070304070606070605030407060405040303040508040504070506040503060304--030405050405060403
5507060405060505060908080506050704060305040704040306070706050604030607050403040403080505040704060505040603040303--0504040506050304
560407050605080809060505060504060703040605060707060304040704050306050604070405050803040403040507060403050605040405--03030403060405
57070406050805090805060605040507060403050607060607040307040504060306050704050408050403030405040607030406050405050403--040306030504
5805060407080905080506060506070504060503040706060704070304030604050407050605080405040303040706040505060403040505040304--0304050306
590605070409080805060505060706040505060403060707060704040306030504070406050805050403040403060705040605030405040405040303--05040603
60050808090407050605040607060505060607070603040605040503060304040704050508050604070405070603040403050404050403050603060405--030304
6108050908070406050405070605060605070606070403050605040603040307040504080506050704050406070403030404050504030406050603050403--0403
620809050805060407060705040506060507060607060503040306040504070304050804050407050607060405040303040405050405060403040503060304--03
63090808050605070407060405060505060607070605060403060305040704040308050504070406050607050403040403050404050605030405040603040303--

This sampling of 64 codewords is not necessarily indicative of the error control performance of all 211 = 2048 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 01:49:13 ADT
Last Updated: 2015-02-06
Richard Tervo [ tervo@unb.ca ] Back to the course homepage...