Programming Language for Ternary Computing
github.com
github.com
> For example, bruijn uses the results of an investigation by Torben Mogensen [2] to implement very efficient operations on balanced ternary numbers.
The Abstract of the referenced paper reads:
> We argue that a compact right-associated binary number representation gives simpler operators and better efficiency than the left associated binary number representation proposed by den Hoed and investigated by Goldberg. This representation is then generalised to higher number-bases and it is argued that bases between 3 and 5 can give higher efficiency than binary representation.
[1] https://bruijn.marvinborner.de/
[2] https://link.springer.com/chapter/10.1007/3-540-45575-2_20 "An Investigation of Compact and Efficient Number Representations in the Pure Lambda Calculus"
It looks like this one stores trits as strings and numbers are then arrays of trit strings.
I would prefer if we just made some silicon for this.
What are your thoughts on ternary computation and neural nets, or general use of it? I myself want to explore some more use cases with utility rather than yak/shaving.
For example, in power stations, the position of switch gear would use 10 and 01 for on/off, 00 for “switch gear in motion” (ie, transiting from on to off or vice versa) and 11 to represent an error state. The in transit condition can persist for several minutes.
Someone let the mathematicians know!
"Brousentsov's Ternary Principle, Bergman's Number System and Ternary Mirror-symmetrical Arithmetic" by Alexy Stakhov:
https://www.semanticscholar.org/paper/Brousentsov%27s-Ternar...
Also available here (but apparently behind a registration/paywall of some sort...):
https://www.researchgate.net/publication/220458145_Brousents...
Or here:
https://ieeexplore.ieee.org/document/8140230
Or, Google for: "Brousentsov's Ternary Principle" and/or "Bergman's Number System" and/or "Ternary Mirror-symmetrical Arithmetic".
Keywords: Ternary Symmetrical Number System, Ternary Tau, Base Phi, Golden Ratio, Fibonnacci, 3-Valued Logic, Number Systems With Transcendental/Irrational Bases, etc., etc.
Related: How e, Pi and Phi are related (despite appearing very different at the surface level!)...
sign * e^(x*yi*zπ)
Or maybe instead: sign * e^(x*yi*zπ*(a_1*inf))
sign * e^(x*i^y*π^z*(inf^a_1))
But that's not ternary at all.Python has `True or False or None`, which you conventionally test with `is`
At the chip level, it is quite common to see tri-state pins, where the states are: high, low, high-impedidence (e.g, let the rest of the circut set the voltage level). You also sometimes see chips that want a to support a handful of potential values have a pin that can be pulled to multiple intermediate voltages; although you typically hardwire the value with resistors.
If you go back far enough, decimal computers were common. The first "real" computer was thr ENIAC which was finished in 1945, and was decimal based. Although even before that, there were more primitive digital computational devices of both the binary and decimal variaty.
The only place you’d see changes are in bitwise/tritwise operations and in limits of fixed-size integers (abs(i) would likely be well defined for all ints, for example, and we would have INT_MAX = -INT_MIN, with values like 3^81 or 3^27).
Ternary floats probably would do away with the distinction between -0 and +0, too.
I've seen one other person in the past many years who A: believed ternary computing was very important and B: was absolutely impossible to convince that there is literally nothing a ternary computer can do that a binary computer can not.
But there is literally nothing a ternary computer can do that a binary computer can not. The reasons why it may be interesting relate to being one possible avenue for squeezing one last drop of hardware performance out of a system that has otherwise reached its limits, but it is minimally interesting from a software perspective.
I think no one is particularly interested in it at this time because there's no step after that; there's no "super ternary" you can go to after that, and for various mathematical reasons stepping up to 4 is much, much less helpful if not actively a step backwards (it turns out that in many ways, 3 is the optimum; actually it's e, but 3 is the closest you can get to that). An optical computer might go faster the next generation, a quantum computer can add more qubits, transistors can be cooled and stacked and built out of graphene and all sorts of other things, but a ternary-ness is a dead end. It's the last thing you do when all else fails.
EDIT: Just saw user 'jerf' post the same below