Non-prime fields Given a prime power q=p^n with p prime and n > 1 , the field \mathrm{GF}(q) may be explicitly constructed in the following way. One first chooses an
irreducible polynomial P in \mathrm{GF}(p)[X] of degree n (such an irreducible polynomial always exists). Then the
quotient ring \mathrm{GF}(q) = \mathrm{GF}(p)[X]/(P) of the polynomial ring \mathrm{GF}(p)[X] by the
principal ideal generated by P is a field of order q. More explicitly, the elements of \mathrm{GF}(q) are the polynomials over \mathrm{GF}(p) whose degree is strictly less than n. The addition and the subtraction are those of polynomials over \mathrm{GF}(p). The product of two elements is the remainder of the
Euclidean division by P of the product in \mathrm{GF}(p)[X]. The multiplicative inverse of a non-zero element may be computed with the extended Euclidean algorithm; see ''''. However, with this representation, elements of \mathrm{GF}(q) may be difficult to distinguish from the corresponding polynomials. Therefore, it is common to give a name, commonly \alpha to the element of \mathrm{GF}(q) that corresponds to the polynomial X. So, the elements of \mathrm{GF}(q) become polynomials in \alpha, where P(\alpha)=0, and, when one encounters a polynomial in \alpha of degree greater or equal to n (for example after a multiplication), one knows that one has to use the relation P(\alpha)=0 to reduce its degree (it is what Euclidean division is doing). Except in the construction of \mathrm{GF}(4), there are several possible choices for P, which produce isomorphic results. To simplify the Euclidean division, one commonly chooses for P a polynomial of the form X^n + aX + b, which make the needed Euclidean divisions very efficient. However, for some fields, typically in characteristic 2, irreducible polynomials of the form X^n+aX+b may not exist. In characteristic 2, if the polynomial X^n+X+1 is reducible, it is recommended to choose X^n+X^k+1 with the lowest possible k that makes the polynomial irreducible. If all these
trinomials are reducible, one chooses "pentanomials" X^n+X^a+X^b+X^c+1, as polynomials of degree greater than 1, with an even number of terms, are never irreducible in characteristic 2, having 1 as a root. A possible choice for such a polynomial is given by
Conway polynomials. They ensure a certain compatibility between the representation of a field and the representations of its subfields. In the next sections, we will show how the general construction method outlined above works for small finite fields.
Field with four elements The smallest non-prime field is the field with four elements, which is commonly denoted \mathrm{GF}(4) or \mathbb{F}_4. It consists of the four elements 0, 1, \alpha, 1 + \alpha such that \alpha^2=1+\alpha, 1 \cdot \alpha = \alpha \cdot 1 = \alpha, x+x=0, and x \cdot 0 = 0 \cdot x = 0, for every x \in \mathrm{GF}(4), the other operation results being easily deduced from the
distributive law. See below for the complete operation tables. This may be deduced as follows from the results of the preceding section. Over \mathrm{GF}(2), there is only one
irreducible polynomial of degree 2: X^2+X+1 Therefore, for \mathrm{GF}(4) the construction of the preceding section must involve this polynomial, and \mathrm{GF}(4) = \mathrm{GF}(2)[X]/(X^2+X+1). Let \alpha denote a root of this polynomial in \mathrm{GF}(4). This implies that \alpha^2 = 1 + \alpha, and that \alpha and 1+\alpha are the elements of \mathrm{GF}(4) that are not in \mathrm{GF}(2). The tables of the operations in \mathrm{GF}(4) result from this, and are as follows: A table for subtraction is not given, because subtraction is identical to addition, as is the case for every field of characteristic 2. To divide, multiply by the reciprocal: . As in any field,
division by zero is undefined. From the tables, it can be seen that the additive structure of \mathrm{GF}(4) is isomorphic to the
Klein four-group, while the non-zero multiplicative structure is isomorphic to the group Z_3. The map \varphi:x \mapsto x^2 is the non-trivial field automorphism, called the
Frobenius automorphism, which sends \alpha into the second root 1+\alpha of the above-mentioned irreducible polynomial X^2+X+1.
GF(p2) for an odd prime p For applying the
above general construction of finite fields in the case of \mathrm{GF}(p^2), one has to find an irreducible polynomial of degree 2. For p=2, this has been done in the preceding section. If p is an odd prime, there are always irreducible polynomials of the form X^2-r, with r in \mathrm{GF}(p). More precisely, the polynomial X^2-r is irreducible over \mathrm{GF}(p) if and only if r is a
quadratic non-residue modulo p (this is almost the definition of a quadratic non-residue). There are \frac{p-1}{2} quadratic non-residues modulo p. For example, 2 is a quadratic non-residue for p=3,5,11,13,\ldots, and 3 is a quadratic non-residue for p=5,7,17,\ldots. If p \equiv 3 \mod 4, that is p=3,7,11,19,\ldots, one may choose -1 \equiv p - 1 as a quadratic non-residue, which allows us to have a very simple irreducible polynomial X^2+1. Having chosen a quadratic non-residue r, let \alpha be a symbolic square root of r, that is, a symbol that has the property \alpha^2=r, in the same way that the complex number i is a symbolic square root of -1. Then, the elements of \mathrm{GF}(p^2) are all the linear expressions a+b\alpha, with a and b in \mathrm{GF}(p). The operations on \mathrm{GF}(p^2) are defined as follows (the operations between elements of \mathrm{GF}(p) represented by Latin letters are the operations in \mathrm{GF}(p)): \begin{align} -(a+b\alpha)&=-a+(-b)\alpha\\ (a+b\alpha)+(c+d\alpha)&=(a+c)+(b+d)\alpha\\ (a+b\alpha)(c+d\alpha)&=(ac + rbd)+ (ad+bc)\alpha\\ (a+b\alpha)^{-1}&=a(a^2-rb^2)^{-1}+(-b)(a^2-rb^2)^{-1}\alpha \end{align}
GF(8) and GF(27) The polynomial X^3-X-1 is irreducible over \mathrm{GF}(2) and \mathrm{GF}(3), that is, it is irreducible
modulo 2 and 3 (to show this, it suffices to show that it has no root in \mathrm{GF}(2) nor in \mathrm{GF}(3), as if a cubic factors then it must contain a linear factor). It follows that the elements of \mathrm{GF}(8) and \mathrm{GF}(27) may be represented by
expressions a+b\alpha+c\alpha^2, where a, b, c are elements of \mathrm{GF}(2) or \mathrm{GF}(3) (respectively), and \alpha is a symbol such that \alpha^3=\alpha+1. The addition, additive inverse and multiplication on \mathrm{GF}(8) and \mathrm{GF}(27) may thus be defined as follows; in following formulas, the operations between elements of \mathrm{GF}(2) or \mathrm{GF}(3), represented by Latin letters, are the operations in \mathrm{GF}(2) or \mathrm{GF}(3), respectively: \begin{align} -(a+b\alpha+c\alpha^2)&=-a+(-b)\alpha+(-c)\alpha^2 \qquad\text{(for } \mathrm{GF}(8), \text{this operation is the identity)}\\ (a+b\alpha+c\alpha^2)+(d+e\alpha+f\alpha^2)&=(a+d)+(b+e)\alpha+(c+f)\alpha^2\\ (a+b\alpha+c\alpha^2)(d+e\alpha+f\alpha^2)&=(ad + bf+ce)+ (ae+bd+bf+ce+cf)\alpha+(af+be+cd+cf)\alpha^2 \end{align}
GF(16) The polynomial X^4+X+1 is irreducible over \mathrm{GF}(2), that is, it is irreducible modulo 2. It follows that the elements of \mathrm{GF}(16) may be represented by
expressions a+b\alpha+c\alpha^2+d\alpha^3, where a,b,c,d are either 0 or 1 (elements of \mathrm{GF}(2)), and \alpha is a symbol such that \alpha^4=\alpha+1 (that is, \alpha is defined as a root of the given irreducible polynomial). As the characteristic of \mathrm{GF}(2) is 2, each element is its additive inverse in \mathrm{GF}(16). The addition and multiplication on \mathrm{GF}(16) may be defined as follows; in following formulas, the operations between elements of \mathrm{GF}(2), represented by Latin letters are the operations in \mathrm{GF}(2). \begin{align} (a+b\alpha+c\alpha^2+d\alpha^3)+(e+f\alpha+g\alpha^2+h\alpha^3)&=(a+e)+(b+f)\alpha+(c+g)\alpha^2+(d+h)\alpha^3\\ (a+b\alpha+c\alpha^2+d\alpha^3)(e+f\alpha+g\alpha^2+h\alpha^3)&=(ae+bh+cg+df) +(af+be+bh+cg+df +ch+dg)\alpha\;+\\ &\quad\;(ag+bf+ce +ch+dg+dh)\alpha^2 +(ah+bg+cf+de +dh)\alpha^3 \end{align} The field \mathrm{GF}(16) has eight
primitive elements (the elements that have all nonzero elements of \mathrm{GF}(16) as integer powers). These elements are the four roots of X^4+X+1 and their
multiplicative inverses. In particular, \alpha is a primitive element, and the primitive elements are \alpha^m with m less than and
coprime with 15 (that is, 1, 2, 4, 7, 8, 11, 13, 14). == Multiplicative structure ==