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) = x11+x10+x6+x5+x4+x2+1

(110001110101)

This polynomial G(x) is degree 11, giving a 11-bit parity field. (See factors of G(x))

The systematic 23-bit codewords will have 12 data bits and 11 parity bits.


Sample (23,12) Codewords  (cyclic)

When codewords are cyclic the circular shift of a valid codeword produces another valid codeword.

For example, rotating the 23-bit codeword (01) left by one bit gives the codeword (02):

(01) = 00000000000110001110101
(02) = 00000000001100011101010

DATA = 00 : 00000000000000000000000
DATA = 01 : 00000000000110001110101
DATA = 02 : 00000000001010010011111
DATA = 03 : 00000000001100011101010
DATA = 04 : 00000000010010101001011
DATA = 05 : 00000000010100100111110
DATA = 06 : 00000000011000111010100
DATA = 07 : 00000000011110110100001
DATA = 08 : 00000000100011011100011
DATA = 09 : 00000000100101010010110
DATA = 10 : 00000000101001001111100
DATA = 11 : 00000000101111000001001
DATA = 12 : 00000000110001110101000
DATA = 13 : 00000000110111111011101
DATA = 14 : 00000000111011100110111
DATA = 15 : 00000000111101101000010
more →

When codewords are linear, any linear combination of codewords is another codeword. For example, the 23-bit codeword (01) is the sum (02)+(03)

(02) = 00000000001010010011111
(03) = 00000000001100011101010
(01) = 00000000000110001110101


Distance Analysis

This sample subset of 23-bit codewords has a minimum distance D=7, correcting up to t=3 errors.

 00010203040506070809101112131415
00--070807070807080807080707121108
0107--0708080708070708070812070811
020807--07070807080807080711080712
03070807--080708070708070808111207
0407080708--0708070712110808070807
050807080707--07081207081107080708
06070807080807--071108071208070807
0708070807070807--0811120707080708
080807080707121108--07080707080708
09070807081207081107--070808070807
1008070807110807120807--0707080708
110708070808111207070807--08070807
12071211080807080707080708--070807
1312070811070807080807080707--0708
141108071208070807070807080807--07
15081112070708070808070807070807--

This sampling of 16 codewords is not necessarily indicative of the error control performance of all 212 = 4096 possible codewords.

To determine the minimum distance between any two codewords in a linear block code, it is sufficient to check every codeword once against the all-zero codeword. In other words, the Hamming distance of a code may be determined from the distances in row 00 only. Moreover, the distance from a given codeword to zero is found by the sum of the 1's in the codeword. The remaining codewords could be easily checked in this way.



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)


2024-04-29 17:15:09 ADT
Last Updated: 2015-02-06
Richard Tervo [ tervo@unb.ca ] Back to the course homepage...