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)

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

The systematic 31-bit codewords will have 21 data bits and 10 parity bits.


Sample (31,21) Codewords  (cyclic)

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

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

(01) = 0000000000000000000011101101001
(02) = 0000000000000000000111011010010

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
more →

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

(02) = 0000000000000000000100110111011
(03) = 0000000000000000000111011010010
(01) = 0000000000000000000011101101001


Distance Analysis

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

 00010203040506070809101112131415
00--070807080708070508071009080706
0107--0708070807080805100708090607
020807--07080708070710050807060908
03070807--070807081007080506070809
0408070807--0708070908070605080710
050708070807--07080809060708051007
06080708070807--070706090807100508
0707080708070807--0607080910070805
080508071009080706--07080708070807
09080510070809060707--070807080708
1007100508070609080807--0708070807
111007080506070809070807--07080708
12090807060508071008070807--070807
1308090607080510070708070807--0708
140706090807100508080708070807--07
15060708091007080507080708070807--

This sampling of 16 codewords is not necessarily indicative of the error control performance of all 221 = 2097152 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. A much larger sampling of 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 15:19:56 ADT
Last Updated: 2015-02-06
Richard Tervo [ tervo@unb.ca ] Back to the course homepage...