-0+
A computer with word-sizes that should be measured in trits, not bits. We will use a 3-trit trybble, a 9-trit tryte, and a 27-trit word. Kleene logic augments the conventional true and false of Boolean logic with a third value, unknown.
Truth value | Unsigned | Balanced | BCB |
---|---|---|---|
false | 0 | - | 11 |
unknown | 1 | 0 | 00 |
truth | 2 | + | 01 |
Binary-coded Balanced
Binary-coded balanced(BCB) is a representation allowing binary computers to manipulate ternary data. In ternary, one trit encodes 3 values. As such, if we use 2 bits per binary-encoded ternary trit.
Unsigned | BCB | Balanced | ||
---|---|---|---|---|
Dec. | Tern. | Tern. | Dec. | |
0 | 00 | 1111 | -- | -4 |
1 | 01 | 1100 | -0 | -3 |
2 | 02 | 1101 | -+ | -2 |
3 | 10 | 0011 | 0- | -1 |
4 | 11 | 0000 | 00 | 0 |
5 | 12 | 0001 | 0+ | 1 |
6 | 20 | 0111 | +- | 2 |
7 | 21 | 0100 | +0 | 3 |
8 | 22 | 0101 | ++ | 4 |
The advantage of BCB over Douglas W.
Jones's BCT is that it makes detecting carry easier, due to
1+1=2
and 2+0=2
giving the same result, whereas if
you add two values that are 0, 1, and 3 you will never get the same sum two
different ways. To convert to the unsigned form, you can do
(x+1)>>1
, and the reverse (x>>1)|x
.
Balanced Trite | |||
---|---|---|---|
tri | - | 0 | + |
bc1 | 11 | 00 | 01 |
int | -1 | 0 | 1 |
Balanced Trybble | |||
try | --- | 000 | +++ |
bc3 | 111111 | 000000 | 010101 |
int | -13 | 000 | 13 |
incoming heptavintimal