TitleLogic Functions over Galois Field G Author(s) Nakao, Zensho Citation 琉球大学工学部紀要 (9): 47-59 Issue Date 985- URL http://hdl.handle.net/.5./ Rights
Bull. Faculty of E?igineering, Univ. of the Ryukyus, No.9,985 47 Logic Functions over Galois Field GF(4) Zensho NAKAO* Abstract The elements of Galois field GF(4) are represented by four numerals {,,, }; it is shown that all quaternary logic functions can be expressed in a sort of standard form as polynomial functions over GF(4); the two field operators of GF(4) are proposed as basic logic gates and are used as basic building blocks in the representation of the logic functions.. Introduction In recent papers, Hachimine and Zukeran [HZ] proposed a set of four-valued logic functions and demonstrated the completeness of the system; they also designed several quaternary logic circuits [HZ]. The objective of this note is to show that how Galois field GF(4) (i.e., a finite field of four elements) can be used effectively to represent quaternary logic functions such as the ones studied in [HZ, HZ] in standard polynominal forms as was done in [Nl, NZK].. Preliminaries The set A = {, } of two symbols, can be made into a Boolean algebra by furnishing it with two binary operations V, A and one unary operation ~ which are defined by the following (truth) tables: V A X X Table. Boolean operators On A, introduce two binary operations +, (or juxtaposition) by the (truth) tables: + Table. Field operators Received: October, 984 Department of Electronics Engineering and Computer Science
48 Logic Functions over Galois Field GF(4) : NAKAO The algebraic operations now transform the structure on A into that of Galois field GF(). In fact, the Boolean algebraic structure (A; V, A, ~) and the field structure (GF(); +, ) are related by the following transformation formulas: () x A y =xy x V y- x + y + xy x=x + l xy = x A y x + y = (x A V (jc A y) Since GF() is a field, the operations in Table define subtraction and division implicitly (name ly, the charts are used backward), which are the operations impossible in the Boolean algebra A. Also, it is known in field theory that we can ajways enlarge GF() to the extension field GF(n) (n is a natural number) which possesses exactly n elements by adjoining a zero of some irreducible polynomial over GF(). In this note we let n = and use GF(4) in studying A4 = {,,, } with a quaternary logic structure. We can obtain GF(4) as the splitting field of the irreducible polynomial p(x) = x + x + over GF() by adjoining a solution a of p(x) = in an extension field of GF(). Since GF(4) is a two dimensional vector field over GF() with the base {, a}, where a = a +, GF(4) has four elements,, a, a +. For ease of reference and computation, we introduce two numerals and, and let a = and a + = ; we obtain the following addition and multiplication tables which are in fact the truth tables for the binary operations: + Table. Field operators Recall that (GF(4); +) is Klein's Viergruppe (hence, not cyclic), and that (GF(4) - {}; ) is a cyclic group of order ; both are Abelian (i.e., the tables are symmetric with respect to the main diagonal). It is to be noted that there are quaternary logic functions on A4 which cannot be expressed as standard Boolean functions, i.e., (A4; V, A, ~) is not a complete system. In the rest of the section, we quote the necessary results from Galois theory: () (* + y) = x + y V x, y G GF(4) () x+x = Vx GF(4) Any function from a finite field into itself is known to be a polymomial function (use Lagrange's interpolation formula, for example); the following results give us the necessary formulas for our specific purpose [T]:
Bull, faculty of Engineering, Univ. of the Ryukyus, Nq9,985 49 (4) Iff:GF(4) GF(4): > GF(4) is a function, then f can be expressed in a polynomial form over f(x) = a + ajx + ax + ax, where a = f(), a, = x^x), ( <. i <. ). xfc w ifl) (5) If f: GF(4) x GF(4) >GF(4) is a mapping, then f can be realized as a polynomial mapping over GF(4) in two variables: f(x,y)= ajjxv, i,k where a = f(,), ai = ^^x^x, ), aoi = ^(, y), Note that in formulas (4) and (5) above, all calculations must be done in Galois field GF(4), and also that (5) can be generalized to mappings f:gf(4)n >GF(4) of n (> ) variables. With this rigid structure, we will be able to express all quaternary logic func tions as polynomial functions on GF(4) or GF(4) (or GF(4)n, if necessary) of total degree at most 6.. Translation of A4 to GF(4) It is proved that (MIN, MAX,x{>),,) forms a complete system of quaternary logic functions in [HZ]; we are going to express all those quaternary logic functions explicitly as polynomials over GF(4), which is a consequence of the evident fact that (GF(4); +, ) is another complete system of quaternary logic functions. The BASIC programs used are included in the Appendix. a. MIN[x, y] Operation tables for the binary operators MIN[x, y] and MAX[x, y] are given below: min MAX Table 4. MIN and MAX operators
5 Logic Functions over Galois Field GF(4) : NAKAO By using formulas for a^ in (5), we can obtain the following results: ao = aoj = a = a = a = a = ao = al = a = a =, a = a = a = a =, a = a = Thus we get a polynomial expression for MINfx, y]: (7) MIN[x, y] = xy + xy + xy + xy + xy + xy + xy By using () and collecting like terms, we can change MlN[x, y] into a less formidable poly nomial in elementary symmetric functions (x + y) and (xy): (8) MIN[x,y] = xy {(x + y) + (x + y)+xy[l+(x + y)]} b. MAX[x, y] Computing similarly as in MIN[x, y], we can derive the following results: (9) ao ~ a " ao = ao = a ~ an = a =, a = a = aoi = aio = a =, a = a = aj = a = Therefore, a polynomial expression for MAX[x, y] is: () MAX[x, y] = x + y + xy + xy + xy + xy + xy + xy + xy Rewriting the result above as a polynomial in (x + y) and (xy), we get: () MAX[x, y] = (x + y) + xy [(x + y) + (x + y) + xy + xy(x + y)] c. x {') The unary operator x{*} is defined by: () A truth table for the operator is given below: = otherwise X X< '> Table 5. Truth table for x{') Repeated applications of the formulas for a{ in (4) yield: O) aft= a = fl -, -n do ^» *i -l, a-, a = Hence, we obtain a polynomial function for x{(}:
Bull. Faculty of Engineering, Unit), of the Ryukyus, No.9,985 5 Putting pieces obtained together, we demonstrated that the algebraic structure (GF(4); +, ) provides an effective method for deriving standard forms of the quaternary logic functions. 4. Other translations For completeness of presentation, we include the polynomial formulas for the binary operator NOR[x, y]; the unary operators (k)x and xw which are discussed in [HZ]. Their definitions follow: (5) NOR[x,y] =+MAX[x,y] (6) (k>x=x + k(mod4), k =,,, (7) x(k) = ifx = k k =,,, = otherwise Polynomial representations for the operators are given in the following: NR[x,y] =+MAX[x,y] = + (x + y) + xy [(x + y) + (x + y) + xy + xy(x + y)] (9) (k>x = (x+k) + xk[+(x+k) + xk], k=,,, () x<k> = [l+(x + k)], k =,,, 5. Conclusions We found that all quaternary logic functions of one or two variables can be realized as poly nomial functions over Galois field GF(4) in one or two variables of total degree at most 6. An obvious advantage for having polynomial expressions is that we can formally manipulate the elements of A4, i.e., GF(4) with four arithmetic operations of GF(4) itself as we normally do with the real (or complex) number field. If we can design (x + y) and (xy) as basic logic circuit elements*, then we can easily construct other circuits such as MIN, MAX, x{'}, NOR, ^>x and xw. For illustration, take MIN, MAX and x{o,} We introduce two logic gate symbols for the operators (x + y) and (xy): (x + y)= Figure. Circuit symbols for (x + y) and (xy) Then the following diagrams present one possible design for each function: *The logic circuit elements were designed by Mr. Chotei Zukeran, Department of Electrical Engine ering, Ryukyu University; and are included as Figures in the Appendix.
5 Logic Functions over Galois Field GF(4) : NAKAO MIN[x,y] Figure. MIN[x, y] gate MAX[x,y] Figure. MAX[x, y] gate r{,} Figure 4. Logic gate for x{'} Some properties of quanternary logic functions over GF(4) will be discussed further in the forth coming paper [N].
Bull. Faculty of Engineering, Univ. of the Ryukyus, Na9,985,5 References [HZ] Hachimine, G and Zukeran, C: A proposal for a complete set of four valued logic func tions and its circuit construction, Trans. IECE (Japanese), 98, pp. 9-. [HZ] : Construction of quaternary logic functions, Trans IECE (Japanese), 98, pp. -8. [Nl] Nakao, Z: A field-theoretic view of logic functions, Bull. Faculty of Engineering, Univ. of the Ryukyus, No. 8,984, pp. 55-66. [N] : Vector-valued representation of quaternary logic functions over Galois field GF(4) (Pre-print). [NZK] Nakao, Z, Zukeran, C and Kyan, S: Quaternary logic functions over Galois field GF(4) (Pre-print). [T] Takahashi, I: Combinatorics and its applications (Japanese), Iwanami 979, pp. 99-4.
54 Logic Functions over Galois Field GF(4) : NAKAO Appendix a. BASIC programs PR#: REM Printer off HOME 4 DIMM(,),A(,),B(),F() 6 FOR I = TO 8 FOR J = TO READ M(I, J): REM Define multiplication NEXT J 4 NEXT I 6 DATA,,,,,,,,,,,,,,, 8 FOR I = TO FOR J = TO READ A(I, J): REM Define addition 4 NEXT J 6 NEXT I 8 DATA,,,,,,,,,,,,,,, 4 HOME 4 PRINT "Type in: f(), f(l), f(), f()" 44 PRINT 46 FOR X = TO 48 INPUT F(X): REM Define the logic function 5 NEXT X 5 PRINT 54 PRINT "Hit any key to continue"; 56 GET A$ 58 HOME 6 PR#: REM Printer on 6 PRINT : REM Display the function table 64 PRINT "x"; " >"; "f(x)" 66 PRINT 68 FOR X = TO 7 PRINT X; " >"; F(x) 7 NEXT X 74 PR#: REM Printer off 76 PRINT 78 REM The coefficients are determined 8 B() = F() 8 B(l) = 84 FORX=TO 86 I = M(X,X) 88 J = M(I, F(X))
Butt. Faculty.of Engineering, Univ. of the Ryukyus, Na9,985 55 9 9 NEXT X 94 B() = 96 FOR X = TO 98 J=M(X, F(X)) B()=A(B(),J) NEXTX 4 B()= 6 FORX = TO 8 J = F(X) B() = A(B(), J) NEXTX 4 REM Output the result in polynomial form 6 PR# : REM Printer on 8 PRINT "f(x)="; B(); "+"; B(l); "x+"; B(); "xx+"; B(); "xxx" PRINT PR# : REM Printer off 4 PRINT "Continue=anykey;Stop=Q"; 6 GET A$ 8 IF A$ = "Q" THEN GOTO 4 END PR#: REM Printer off HOME 4 DIM M(, ), A(, ), B(, ), F(, ) 6 FOR = TO 8 FORJ = TO READ M(I, J): REM Define multiplication NEXT J 4 NEXT I 6 DATA,,,,,,,,,,,,,,-, 8 FOR I = TO FOR J = TO READ A(I, J): REM Define addition 4 NEXT J 6 NEXT I 8 DATA,,,,,,,,,,,,,,, 4 HOME 4 PRINT "Type in: f(, ), f(, ), f(, ), f(,), f(l, ), f(l, ), f(l, ), f(l, ), f(,), 44 PRINT f(, ), f(,), f(,), f(,), f(,), f(,), f(,)"
56 Logic Functions over Galois Field GF('l) : NAKAO 46 FOR I = TO 48 FOR J = TO 5 INPUT F(I, J): REM Define the logic function 5 NEXT J 54 NEXT I 56 PRINT 58 PRINT "Hit any key to continue"; 6 GET AS 6 HOME 64 PR# : REM Printer on 66 PRINT : REM Display the function table 68 PRINT "(x, y)";" >"; "f(x, y)" 7 PRINT 7 FOR I = TO 74 FOR J = TO 76 print "(";i;v;j;")";" >";F(i,j) 78 NEXT J 8 NEXT I 8 PR# : REM Printer off 84 PRINT 86 REM The coefficients are determined 88 B(,O) = F(,O) 9 B(,) = : B(,) = O 9 FORX = TO 94 I = M(X,X) 96 J = MO, F(X,' )): K = M(I, F(, X)) 98 B(l, ) = A(B(, ), J): B(,) = A (B(,), K) NEXT X B(,) = : B(,)= 4 FORX = TO 6 J = M(X, F(X, )): K = M (X, F(, X)) 8 B(, ) = A(B(, ), J): B(,) = A(B(,), K) NEXTX B(,)=: B(,)= 4 FORX = TO 6 J = F(X,): K = F(,X) 8 B(, ) = A(B(, ), J): B(,) = A(B(,), K) NEXTX B(l,l) = 4 FORX = TO 6 FORY = TO 8 I = M(X,X): I = M(Y,Y)
Bull. Faculty of Engineering, Univ. of the Ryukyus, No.9,985 57 J=M(I,I): J = M(J,F(X,Y)) B(l, ) = A(B(,),J) 4 NEXTY 6 NEXT X 8 B(l,) = : B(,l) = 4 FORX=TO 4 FORY = TO 44 = M(X, X): = Y: Kl = X: K = M(Y, Y) 46 Jl = M(I,): J = M(J, F(X, Y)) 48 LI = M(K, K): L = M(L, F(X, Y)) 5 B(l,)= A(B(,),J);B(, ) = A(B(, ), L) 5 NEXTY 54 NEXTX 56 B(l,) = : B(, ) = 58 FORX=TO 6 FORY = TO 6 I=M(X,X): K = M(Y, Y) 64 Jl = M(I, F(X, Y)): J = M(K, F(X, Y)) 66 B(l, ) = A(B(,), Jl): B(,) = A(B(, ), J) 68 NEXTY 7 NEXTX 7 B(,) = 74 FORX = TO 76 FORY = TO 78 = M(X, Y): = M(I, F(X, Y)) 8 B(, ) = A(B(, ), ) 8 NEXTY 84 NEXTX 86 B(,) = : B(,) = 88 FORX = TO 9 FORY = TO 9 II = M(X, F(X, Y)): = M(Y, F(X, Y)) 94 B(,) = A(B(, ), II): B(,) = A(B(,), ) 96 NEXTY 98 NEXTX B(, ) = FOR X = TO 4 FOR Y = TO 6 B(,)=A(B(,),F(X,Y)) 8 NEXT Y NEXTX REM Output the result in polynomial form 4 PR#: REM Printer on
58 Logic Functions over Galois Field GF(4) : NAKAO 6 PRINT "f(x, y) ="; B(, ): "+"; B(l, ): *x+"; B(, ); "y+"; B(,); "xx+"; B(l, ); "xy+"; B(,); "yy*-";b(,); "xxx+"; B(,); "xxy+"; B(l,); "xyy+"; B(,); "yyy+"; B(,); "xxxy+"; B(,); "xxyy+"; B(l,); "xyyy+"; B(, ); "xxxyy+"; B(, ); "xxyyy+"; B(, ); "xxx" 8 PRINT PR#: REM Printer off PRINT "Continue=any key;stop=q"; 4 GET A$ 6 IF A$ = "Q" THEN 8 GOTO 4 END b. Logic gates + 5V +5V x+y Figure A.. (x+y) gate
Dull. Faculty of Engineering, Univ. of the Ryukyus. No.9,985 59 + 5V xy Figure A.. (xy) gate