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."
Single Input Gates
The gate names uses the heptavintimal notation.
Reversible Gates
- Identity(U): 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.
- Negation(E): 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.
- Increment(G) and Decrement(K): 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.
- And gates O and S.
To learn more, see reversible computing.
| + | 0 | - | Number | Name | Definitions |
0 | - | - | - | -13 | False | NEG(LAX(LAX)) |
A | - | - | 0 | -12 | | NEG(LAX) |
B | - | - | + | -11 | Decoder(-) | DEC(DEC(LAX)) |
C | - | 0 | - | -10 | Abn | NEG(LAX(DEC)) |
D | - | 0 | 0 | -9 | | DEC(LAX(NEG)) |
E | - | 0 | + | -8 | Negation | NEG |
F | - | + | - | -7 | Decoder(0) | DEC(DEC(LAX(DEC))) |
G | - | + | 0 | -6 | Increment | DEC(DEC) |
H | - | + | + | -5 | | DEC(NEG(LAX(NEG))) |
I | 0 | - | - | -4 | | NEG(LAX(NEG)) |
J | 0 | - | 0 | -3 | | DEC(LAX(DEC)) |
K | 0 | - | + | -2 | Decrement | DEC |
L | 0 | 0 | - | -1 | | DEC(LAX) |
M | 0 | 0 | 0 | 0 | Clear | DEC(LAX(LAX)) |
N | 0 | 0 | + | 1 | | NEG(DEC(LAX)) |
O | 0 | + | - | 2 | | NEG(DEC) |
P | 0 | + | 0 | 3 | | NEG(DEC(LAX(DEC))) |
Q | 0 | + | + | 4 | | LAX(NEG) |
R | + | - | - | 5 | Floor/Decoder(+) | DEC(DEC(LAX(NEG))) |
S | + | - | 0 | 6 | | DEC(NEG) |
T | + | - | + | 7 | | DEC(NEG(LAX(DEC))) |
U | + | 0 | - | 8 | Identity | NEG(NEG) |
V | + | 0 | 0 | 9 | Flat | NEG(DEC(LAX(NEG))) |
W | + | 0 | + | 10 | Abs | LAX(DEC) |
X | + | + | - | 11 | Ceil | DEC(NEG(LAX)) |
Y | + | + | 0 | 12 | Lax | LAX |
Z | + | + | + | 13 | True | LAX(LAX) |
AND |
B |
F |
U |
T |
A |
F |
F |
F |
F |
U |
F |
U |
U |
T |
F |
U |
T |
OR |
B |
F |
U |
T |
A |
F |
F |
U |
T |
U |
U |
U |
T |
T |
T |
T |
T |
Inputs |
|
Outputs |
X |
Y |
|
TNAND |
TNOR |
−1 |
−1 |
|
1 |
1 |
−1 |
0 |
|
1 |
0 |
−1 |
1 |
|
1 |
−1 |
0 |
−1 |
|
1 |
0 |
0 |
0 |
|
0 |
0 |
0 |
1 |
|
0 |
−1 |
1 |
−1 |
|
1 |
−1 |
1 |
0 |
|
0 |
−1 |
1 |
1 |
|
−1 |
−1 |