Ternary_logic Ternary_logic

Ternary logic - Definition and Overview

Related Words: Leash, Shamrock, Tercet, Tern, Ternate, Three, Threesome, Treble, Trefoil, Trey, Triad, Triangle, Tricorn, Trident, Trilogy

Ternary logic is a multi-valued logic in which there are three truth values indicating true, false and unknown.

Contents

Formal definitions

Significations

In ternary logic, the number symbols 0, 1, and 2 are usually assigned to the following truth values (or some permutation thereof):

  • 0 means unknown
  • 1 means true
  • 2 means false

Ternary operators

Inversion (NOT)

The negation operator should interchange truth and falsehood, while leaving the third value unchanged, since the negation of an unknown statement is still unknown. Thus:

  • NOT(0) = 0
  • NOT(1) = 2
  • NOT(2) = 1

Conjunction (AND), Disjunction (OR), Implication (IF...THEN), and Equivalence (EQUALS)

The binary operators can also be evaluated under this truth value interpretation. The result is:

Ternary logic operators
x y X <math>\wedge<math> Y X <math>\vee<math> Y X → Y X ↔ Y
00 0011
01 0110
02 2000
10 0100
11 1111
12 2122
20 2010
21 2112
22 2211

Note that any two statements with the same truth value are equivalent, even if the truth value is unknown.

Other operators

All other ternary logic operators can be simulated by the four basic operators NOT, AND, OR and IF...THEN.

The 27 one-variable functions in ternary logic are represented in the following table. Some of them are given names:

0 1 2
f0, "clear to 0" 0 0 0
f1, "shift down" 0 0 1
f2 0 0 2
f3 0 1 0
f4 0 1 1
f5, "identity" 0 1 2
f6 0 2 0
f7. "NOT" 0 2 1
f8 0 2 2
f9 1 0 0
f10 1 0 1
f11, "swap 0/1" 1 0 2
f12 1 1 0
f13, "clear to 1" 1 1 1
f14 1 1 2
f15, "rotate up" 1 2 0
f16 1 2 1
f17, "shift up" 1 2 2
f18 2 0 0
f19, "rotate down" 2 0 1
f20 2 0 2
f21, "swap 0/2" 2 1 0
f22 2 1 1
f23 2 1 2
f24 2 2 0
f25 2 2 1
f26, "clear to 2" 2 2 2


The number of functions for a given number of variables for trinary logic can be calculated by the equation <math>3^{3^v}<math>, where v represents the number of variables. This gives us

  • 27 one-variable functions in ternary logic (as compared to only 4 one-variable Boolean functions).
  • 19,683 two-variable functions in trinary logic (compared with 16 for binary), and
  • 7,625,597,484,987 three-variable functions.

Two-argument functions

Commutativity

As stated above, there are 19,683 two-argument ternary functions. However, only 729 (<math>3^{bc(2, 3)}<math>, where bc is the binomial coefficient) of these are commutative. Of the four functions defined above, OR, AND, and EQUIV are commutative, while IF/THEN is not. For comparison, there are 8 two-argument binary functions.

Implementation

  • Setun a computer actually implemented in ternary logic.

External links

See also: Digital circuit, Ternary, Boolean algebra, Boolean function, binary logic.

Copyright 2009 WordIQ.com - Privacy Policy  :: Terms of Use  :: Contact Us  :: About Us
This article is licensed under the GNU Free Documentation License. It uses material from the this Wikipedia article.