| Communications Toolbox | ![]() |
The code below computes the logarithm of the elements of a Galois array. The output indicates how to express each nonzero element of GF(8) as a power of the primitive element. The logarithm of the zero element of the field is undefined.
gf8_nonzero = gf([1:7],3); % Vector of nonzero elements of GF(8) expformat = log(gf8_nonzero) % Logarithm of each element
The output is
expformat =
0 1 3 2 6 4 5
As an example of how to interpret the output, consider the last entry in each vector in this example. You can infer that the element gf(7,3) in GF(8) can be expressed as either
A5, using the last element of expformat
A2+A+1, using the binary representation of 7 as 111. See Example: Representing Elements of GF(8) for more details.
| Example: Exponentiation | Logical Operations in Galois Fields | ![]() |
© 1994-2005 The MathWorks, Inc.