Main Page

encyclopedia.codeboy.net

 

Ternary

Ternary is the base 3 numeral system. Ternary digits are known as trits, analogous to bit. Although ternary most often refers to a system in which the three numerals, zero, one and two, are all positive integers, the adjective also lends its name to the balanced ternary system, in which case it is useful for those seeking the representation of both positive and negative numbers. It would also supposedly be of use to a race of creatures with three digits or three arms. \n\n\n\n\n
Decimal012345678910
Ternary012101112202122100101

Table of contents
1 Ternary computers
2 Balanced ternary notation
3 Compact ternary representation
4 External links

Ternary computers

\n* Setun \nSee also: Ternary logic

Balanced ternary notation

\nThere is also a number system called balanced ternary, which uses digits with the values -1, 0, and 1. It works as follows. (In this example, the symbol 1 denotes the digit -1.) \n\n\n\n\n
Decimal-6-5-4-3-2-10123456
Balanced ternary110111111011101111011111110
Unbalanced ternary can be converted to balanced ternary notation by adding 1111.. with carry, then subtracting 1111... without borrow. For example, 0213 + 1113 = 2023, 2023 - 1113 = 1113(bal) = 710. Balanced ternary is easily represented as electronic signals, as potential can either be negative, neutral, or positive. Utilizing the third previously ignored state allows for much more data per digit; linearly approximately log(3)/log(2)=~1.589 bits per trit. Balanced ternary has other applications. For example, a classical "2-pan"
balance, with one weight for each power of 3, can weigh relatively heavy objects accurately with a small number of weights, by moving weights between the two pans and the table. For example, with weights for each power of 3 through 81, a 60-gram object will be balanced perfectly with a 81 gram weight in the other pan, the 27 gram weight in its own pan, the 9 gram weight in the other pan, the 3 gram weight in its own pan, and the 1 gram weight set aside. This is an optimal solution in terms of the number of weights needed to weigh any object. 60 = 11110

Compact ternary representation

\nTernary is inefficient for human usage, just as binary is. Therefore,
novenary (base 9, each digit is two base-3 digits) or base 27 (each digit is 3 base-3 digits) is often used, similar to how octal and hexadecimal systems are used in place of binary.

External links

\n*
Development of ternary computers at Moscow State University\n*Third Base\n*Nikolay Brusentsov\n*Balanced Ternary Web Pages\n*Ternary Arithmetic

"I choose a block of marble and chop off whatever I don't need." - Francois-Auguste Rodin (1840-1917), when asked how he managed to make his remarkable statues