Communications Toolbox    
gfprimfd

Find primitive polynomials for a Galois field

Syntax

Description

For all syntaxes:

pol = gfprimfd(m) returns the row vector representing one primitive polynomial for GF(2m). m is a positive integer.

pol = gfprimfd(m,opt) searches for one or more primitive polynomials for GF(2m), where m is a positive integer. If > 1, then the output pol depends on the argument opt as shown in the table below.

opt
Significance of pol
Format of pol
'min'
One primitive polynomial for GF(2m) having the smallest possible number of nonzero terms
The row vector representing the polynomial
'max'
One primitive polynomial for GF(2m) having the greatest possible number of nonzero terms
The row vector representing the polynomial
'all'
All primitive polynomials for GF(2m)
A matrix, each row of which represents one such polynomial
A positive integer
All primitive polynomials for GF(2m) that have opt nonzero terms
A matrix, each row of which represents one such polynomial

pol = gfprimfd(m,opt,p) is the same as pol = gfprimfd(m,opt) except that 2 is replaced by a prime number p.

Examples

The code below seeks primitive polynomials for GF(32) having various other properties. Notice that fourterms is empty because no primitive polynomial for GF(32) has exactly four nonzero terms. Also notice that manyterms represents a single polynomial having five terms, while fiveterms represents all of the five-term primitive polynomials for GF(32).

The output is below.

Algorithm

gfprimfd tests for primitivity using gfprimck. If opt is 'min', 'max', or omitted, then polynomials are constructed by converting decimal integers to base p. Based on the decimal ordering, gfprimfd returns the first polynomial it finds that satisfies the appropriate conditions.

See Also
gfprimck, gfprimdf, gftuple, gfminpol


 gfprimdf gfrank