[HN Gopher] The Ternary Manifesto (2012)
       ___________________________________________________________________
        
       The Ternary Manifesto (2012)
        
       Author : todsacerdoti
       Score  : 66 points
       Date   : 2021-02-25 12:20 UTC (2 days ago)
        
 (HTM) web link (homepage.divms.uiowa.edu)
 (TXT) w3m dump (homepage.divms.uiowa.edu)
        
       | cyberlab wrote:
       | At first I thought this was something to do with ternary
       | operators[0]. I know in JS you can do something like this:
       | var resultofexpression = conditionasboolean ? truepart:
       | falsepart;
       | 
       | You can actually get away with /never/ using if...else statements
       | and do everything with ternary operators, but it's harder to
       | comprehend the code.
       | 
       | Also as a separate observation: Adding quantum computers into the
       | mix of these writings would really jazz it up.
       | 
       | [0] https://www.javascripttutorial.net/javascript-ternary-
       | operat...
        
       | LargoLasskhyfv wrote:
       | The date of publication is causing irritation.
        
       | dooglius wrote:
       | Start date is April 1 but other sections were written later, so
       | I'm not sure if this is serious.
       | 
       | The main problem I see, unaddressed in my skimming, is the analog
       | level: you need to replace the transistor with something more
       | sophisticated, or possibly two different types of transistors.
       | 
       | Worth noting: SSDs do store data in multi-level cells (generally
       | with much more than 3 levels) to get better density out, but they
       | can get away with this because the performance requirements are
       | much lower than those of a CPU and it's not doing any actual
       | logic, just translation.
        
         | bayindirh wrote:
         | The manifesto clearly states that
         | 
         | > While this work began as something of a joke, there are some
         | very serious reasons that ternary logic may have value.
         | 
         | So, it's semi-serious.
        
         | rini17 wrote:
         | I think problem in high frequency ternary isn't primarily
         | transistors but interconnection. When using voltage levels like
         | -1, 0, 1 on one wire, switching from -1 to 1 goes through 0
         | briefly and you need to guard against that. Binary does not
         | have this problem. Using two wires (which take up 2x space)
         | introduces intermediate states instead by timing differences
         | between individual wires. This case is ubiquitous problem also
         | in binary, called hazards. There are various solutions, like
         | gray code (only one wire changes at a time) but they increase
         | complexity.
         | 
         | Perhaaaaps if we had photonics with polarization signalling in
         | 3 axes....
        
           | drran wrote:
           | Maybe we should use phase instead of voltage level. For
           | terahertz computations we will need completely different
           | physics anyway. For example, p-p-p can encode 0, p--p-p --
           | +1, p-p--p -- -1, where p is pulse.
        
             | sitkack wrote:
             | I believe Japan produced some computers that ran on phase.
             | Late 50s-60s. Please correct me.
        
         | retrac wrote:
         | The author (Doug Jones) has a bit of a taste for projections of
         | questionable utility but high didactic value. (I can
         | sympathize!) See his instruction set designs that'll never be
         | implemented, but which offer interesting ideas. This would be a
         | project in that vein. It's very serious. But it's not.
         | 
         | Building a ternary computer requires you to think completely
         | outside the box. You even have to pick _which_ kind of ternary
         | "Boolean" logic you'll use, as there's no consensus on how 3VL
         | should work. Then fill out all the 3^9 possible basic logical
         | operations and pick a few logically universal ones as building
         | blocks. And then you have to design circuits to implement them.
         | And none of your existing bit-twiddling logic designs -- or
         | algorithms -- will work. It's total re-invention of the wheel,
         | really.
         | 
         | But it's mostly a thought experiment. While there are
         | theoretical advantages, ternary machines are, in honesty,
         | unlikely to ever offer any real advantage over binary ones.
         | More electronic complexity for something you can trivially
         | simulate on a binary machine. But it does make you think.
        
       | rthomas6 wrote:
       | Problem is, binary computers have decades of R&D and supporting
       | infrastructure. A lot would have to be retooled for trinary; you
       | can't even power the chips in the same way. Not to mention the
       | surrounding technology such as RAM and bus architecture. You're
       | essentially starting from scratch in a few ways. I'm not saying
       | it couldn't be done, just that it would take a lot of years and a
       | lot of money to get it up to speed.
        
         | spenczar5 wrote:
         | Of course, you are right. But one wonders whether things may
         | change on much longer timescales (hundreds or even thousands of
         | years). Certainly, there have been past technologies which got
         | entrenched in a suboptimal spot, and were later radically
         | altered.
         | 
         | "The thing about cars is that everybody already knows how to
         | ride a horse, and you can find a stable in any village in
         | Europe. They work even on rough roads and they are much
         | cheaper. Their "fuel" can be found basically anywhere. Cars may
         | be nice but I can't see them winning out."
         | 
         | No claim that ternary is to cars as binary is to horses; I
         | think the difference is way less. But its a fun way to think
         | about the argument "we won't change because the existing
         | technology has too many decades behind it."
        
           | rcxdude wrote:
           | It's not so clear ternary would actually be an improvement:
           | at least in terms of how we can implement circuits today,
           | ternary's radix efficiency is offset by the inefficiency of
           | implementing ternary logic. It might work if you have a new
           | way of constructing logic circuits where this efficiency
           | difference doesn't appear.
           | 
           | (see https://arxiv.org/abs/1908.06841)
        
       | lr1970 wrote:
       | Russians build balanced ternary computer in 1958 [1] and were
       | experimenting improving its design up until early 1970-th.
       | 
       | [1] https://en.wikipedia.org/wiki/Setun
        
       | kibwen wrote:
       | In terms of sheer aesthetics, ternary computing is interesting
       | because base-3 is the integer base with the highest numeric
       | information density
       | (https://en.m.wikipedia.org/wiki/Radix_economy) due to being the
       | nearest integer to _e_. Of course, the second-best integer base
       | by this metric is base-2, by a rather slim margin. :P That said,
       | I presume this is the basis for:
       | 
       | "Donald Knuth argues that [ternary computers] will be brought
       | back into development in the future to take advantage of ternary
       | logic's elegance and efficiency."
       | 
       | https://en.wikipedia.org/wiki/Ternary_computer#Potential_fut...
        
         | brandmeyer wrote:
         | Radix economy doesn't make sense on its own, IMO. You've got to
         | incorporate signal strength somehow. Its like arguing that TPSK
         | outperforms BPSK and QPSK on certain metrics. Meanwhile, the
         | world moved on to higher-modulation QAM and OFDM.
         | 
         | Phrased a little differently: radix economy is obsolete - you
         | should be using the Shannon channel capacity limit to analyze
         | the system's information density.
        
         | fallingknife wrote:
         | In the link base 4 is shown to be equal to base 2 in radix
         | economy. So maybe base 4 is a good choice as it would take up
         | half the number of bits (quits?).
        
         | retrac wrote:
         | I'm unsure if it counts as elegant. It's so large. But maybe
         | our minds are too small to see the elegance!
         | 
         | Ternary logic is an enormous space, mathematically. In two
         | value Boolean, there are 16 distinct binary operators, many of
         | which are useless values (such as identity). We're basically
         | left with the family of NAND/NOR/XOR and their complements.
         | NAND/NOR, or their complement and NOT, are universal and can
         | construct the rest. In some 3VL like Kleene, there's 3^9 (about
         | 20,000) possible operators, many of which are logically
         | universal.
         | 
         | Boolean NAND and AND-OR-INVERT are universal and map very
         | nicely to CMOS. But it's likely many (as in dozens or hundreds)
         | of different universal gates in 3VL map nicely into electronic
         | structures. (Assuming the existence of circuits for 3VL.) It's
         | such a large space to explore that we've only begun to scrape
         | the surface.
        
           | petschge wrote:
           | One thing that really cuts down on the number of operators
           | that you need to consider is the requirement of symmetry. If
           | two inputs are swapped you still want the same output. In
           | binary this requirement removes 8 of the 16 operators. The
           | fact that we don't want the output stuck at true of false
           | removes another two and we are left with the six common,
           | useful operations.
           | 
           | If you impose this symmetry condition on ternary operators,
           | the huge number of 19683 operators is cut down to 729. Three
           | of those are stuck to one of the three output states and can
           | be ignored as well. If you additionally require that changing
           | an input from 0 to 1 (or to -1) can not make a definite (non-
           | zero) output to 0 (less certain) nor flip it, you cut the
           | total list of operators down to just 64 operators.
           | 
           | Of course 64 operators is much more than 6, it is not as bad
           | as going from 16 to 20k.
        
             | neolog wrote:
             | > If you additionally require that changing an input from 0
             | to 1 (or to -1) can not make a definite (non-zero) output
             | to 0 (less certain) nor flip it
             | 
             | Why does it make sense to require those conditions?
        
               | petschge wrote:
               | It ONLY makes sense if you view trinary as (false,
               | uncertain, true or -1,0,+1). That is NOT the only view of
               | trinary, but it is useful for e.g. soft-decision
               | decoders.
        
             | sdenton4 wrote:
             | FWIW, in ternary the x->-x is a new 'uninteresting'
             | symmetry, so for any non-constant-zero operation F(x, y)
             | you've got a paired -F(x, y). If these pairs are
             | uninteresting (eg, you can run the operation -F for free,
             | given F), you can cut the number of operators by another
             | factor of 2.
             | 
             | More generally, if you allow composition of a permutation
             | of the trit values 'for free', (eg, F(x,y) + 1 is 'free'
             | given F) you get to reduce the 'atomic' operations by a
             | factor of 6. This is the same as collapsing 'G' and 'not G'
             | among binary operators.
             | 
             | But I guess you've got to implement these in circuits at
             | some point, so the symmetries aren't necessarily helpful
             | (eg, NAND is a thing, rather than AND composed with a
             | symmetry?). (caveat: i am, obviously, more a mathematician
             | than a circuit designer. :P )
        
               | petschge wrote:
               | So far I have imposed mainly F(x,y) = F(y,x). You could
               | also enforce F(-x,-y) = -F(x,y), but I have not done
               | that.
               | 
               | The second reduction that I mention is actually to
               | require every F to satisfy either F(-1,y) <= F(0,y) <=
               | F(1,y) OR F(-1, y) >= F(0,y) >= F(1,y).
               | 
               | And no the symmetries are not that useful to implement
               | the circuitry, but are nice to select operators that
               | compose nicely and allow many simplifications (think De
               | Morgan's laws)
        
         | rcxdude wrote:
         | Also, this efficiency is generally offset by the increased
         | inefficiency of the implementations of the operations[1]. For
         | communication any number of symbols may be optimal depending on
         | the nature of the channel, but for computation it definitely
         | looks like binary is better, at least until we move to a
         | fundamentally different way of constructing logic.
         | 
         | [1] https://arxiv.org/abs/1908.06841
        
       ___________________________________________________________________
       (page generated 2021-02-27 23:01 UTC)