Main Content

gfprimdf

Provide default primitive polynomials for Galois field

Description

pol = gfprimdf(m) outputs the default primitive polynomial pol in GF(2m).

Note

This function performs computations in GF(pm), where p is prime. To work in GF(2m), use the primpoly function. For details, see Finding Primitive Polynomials in Primitive Polynomials and Element Representations.

example

pol = gfprimdf(m,p) returns the row vector that gives the coefficients, in order of ascending powers, of the default primitive polynomial for GF(pm).

Examples

collapse all

Find the default primitive polynomial for GF(52) by using the gfprimdf function. Then use the gfpretty function to display it in polynomial format.

pol = gfprimdf(2,5)
pol = 1×3

     2     1     1

gfpretty(pol)
 
                                           2
                                  2 + X + X 

Find the default primitive polynomials for a range of Galois fields by using the gfprimdf function.

Use the gfpretty function to display the default primitive polynomial for each of the fields GF(3m), where the range for m is [3, 5].

for m = 3:5
   gfpretty(gfprimdf(m,3))
end
 
                                            3
                                 1 + 2 X + X 
 
                                           4
                                  2 + X + X 
 
                                            5
                                 1 + 2 X + X 

Input Arguments

collapse all

Degree of primitive polynomial, specified as a positive integer.

Data Types: single | double

Prime number, specified as a positive integer.

Data Types: single | double

Output Arguments

collapse all

Coefficients of the default primitive polynomial in ascending order, returned as a row vector.

Data Types: single | double

Version History

Introduced before R2006a