 ## Notes on Ternary Logic.

Along with ternary arithmetic, a computer built of ternary hardware can also exploit ternary logic. Consider the task of comparing two numbers. In a machine based on binary logic, comparison is often a two-stage process. First you ask, "Is x less than y?"; depending on the answer, you may then have to ask a second question, such as "Is x equal to y?" Ternary logic simplifies the process: A single comparison can yield any of three possible outcomes: "less," "equal" and "greater."

### Reversible Gates

• NOP: The most dull gate (number 8) this does not change the input. It is its own complement. Applying it any number of times get you back to your intial value.
• NEG Gate: Balanced ternary gates have a tighter relationship between logical and mathmatical negation. The are the same bitwise operator. It is its own complement. Applying it multiple time every even application brings back the intial value.
• INC and DEC Gate: These gates can arithmetically be thought of as single trit increment or decrement without carry, but with roll over. These gates are also complementary . Every 3 applications of either one of these gates in a row bring back the intial value.
• Gate 2 & 6: The these gates are most intuitively expressed as combinations of NEG, INC and DEC.

### Single Input Gates

+0-NumberNameDefinitions
----13FalseNEG(LAX(LAX))
--0-12NEG(LAX)
--+-11DEC(DEC(LAX))
-0--10AbnNEG(LAX(DEC))
-00-9DEC(LAX(NEG))
-0+-8NegNEG
-+--7isZDEC(DEC(LAX(DEC)))
-+0-6IncDEC(DEC)
-++-5DEC(NEG(LAX(NEG)))
0---4NEG(LAX(NEG))
0-0-3DEC(LAX(DEC))
0-+-2DecDEC
00--1DEC(LAX)
0000ClearDEC(LAX(LAX))
00+1NEG(DEC(LAX))
0+-2NEG(DEC)
0+03NEG(DEC(LAX(DEC)))
0++4LAX(NEG)
+--5FloorDEC(DEC(LAX(NEG)))
+-06DEC(NEG)
+-+7DEC(NEG(LAX(DEC)))
+0-8NOPNEG(NEG)
+009FlatNEG(DEC(LAX(NEG)))
+0+10AbsLAX(DEC)
++-11CeilDEC(NEG(LAX))
++012LaxLAX
+++13TrueLAX(LAX)