Why binary and not ternary computing? [closed]
Asked Answered
S

15

91

Isn't a three state object immedately capable of holding more information and handling larger values? I know that processors currently use massive nets of XOR gates and that would need to be reworked.

Since we are at 64 bit (we can represent 2^63 possible states) computing the equivalent ternary generation could support number with 30 more tens places log(3^63-2^63).

I imagine it is as easy to detect the potential difference between +1 and 0 as it is between -1 and 0.

Would some compexity of the hardware, power consumption, or chip density offset any gains in storage and computing power?

Suspire answered 18/4, 2009 at 23:15 Comment(1)
64 bits -> 2^64, 64 trits -> 3^64, not 63Chart
T
70
  • It is much harder to build components that use more than two states/levels/whatever. For example, the transistors used in logic are either closed and don't conduct at all, or wide open. Having them half open would require much more precision and use extra power. Nevertheless, sometimes more states are used for packing more data, but rarely (e.g. modern NAND flash memory, modulation in modems).

  • If you use more than two states you need to be compatible to binary, because the rest of the world uses it. Three is out because the conversion to binary would require expensive multiplication or division with remainder. Instead you go directly to four or a higher power of two.

These are practical reasons why it is not done, but mathematically it is perfectly possible to build a computer on ternary logic.

Termless answered 19/4, 2009 at 5:33 Comment(7)
we're not talking about modern times here. At the time ternary computers were considered, the rest of the world was still (also) working on the binary computersDrapery
Yes, modern hardware would be a problem but that would be why need new hardware, yes it would be expensive at first but much like current hardware price with fall with time. As another who is deeply involved with this topic, I say there is no good reason not to.Peppery
Also: If a bit is a piece of binary data, what would a piece of ternary data be...?Ethelred
@Askan Pretty sure it's known as a trit.Sapsucker
"expensive"?? Sounds like you're micro-optimizing.Rimskykorsakov
what is the memory speed aspect?Edomite
The third state is a ground state.Fournier
L
48

Lots of misinformation here. Binary has a simple on/off switch. Trinary/Ternary can use one of 2 modes: Balanced aka -1, 0, +1, or unbalanced 0, 1, 2, but is not simply on or off, or more correctly, has 2 "on" states.

With the expansion of fiber optics and expansive hardware, ternary would actually take us to a much more expansive and faster state for a much lower cost. Modern coding could still be used (much like 32 bit software is still able to be used on 64 bit hardware) in combination with newer ternary codes, at least initially. Just need the early hardware to check which piece of info coming through, or the software to announce ahead of time if it is a bit or a trit. Code could be sent through 3 pieces at a time instead of the modern 2 for the same or less power.

With fiber optic hardware, instead of the modern on/off binary process, it would be determined by 0=off and the other 2 switches as orthogonal polarizations of light. As for security, this could actually be made massively more secure for the individual as each PC or even user is set to a specific polarization "specs" that is only to be sent/received between the user and the destination. The same would go for the "gates" with other hardware. They would not need to be bigger, just have the option for 3 possibilities instead of 2.

There has even been some theories and even possibly starting some tests on the Josephson Effect which would allow for ternary memory cells, using circulating superconducting currents, either clockwise, counterclockwise, or off.

When compared directly, Ternary is the integer base with the highest radix economy, followed closely by binary and quaternary. Even some modern systems use a type of ternary logic, aka SQL which implements ternary logic as a means of handling NULL field content. SQL uses NULL to represent missing data in a database. If a field contains no defined value, SQL assumes this means that an actual value exists, but that the value is not currently recorded in the database. Note that a missing value is not the same as either a numeric value of zero, or a string value of zero length. Comparing anything to NULL—even another NULL—results in an UNKNOWN truth state. For example, the SQL expression "City = 'Paris'" resolves to FALSE for a record with "Chicago" in the City field, but it resolves to UNKNOWN for a record with a NULL City field. In other words, to SQL, an undefined field represents potentially any possible value: a missing city might or might not represent Paris. This is where trinary logic is used with modern day binary systems, albeit crude.

Landlord answered 5/9, 2011 at 6:27 Comment(7)
This is a late response that probably won't do anyone any good, but I contend that your comparison of the binary/trinary transition being analogous to the 32-bit/64-bit transition is fallacious. In the latter case, nothing truly changed about the function of the hardware at a fundamental level; the instruction mov eax, ebx will do precisely the same thing in either instruction set. With the trinary/binary distinction, this is no longer a reasonable guarantee: a trinary register may look very different from a binary register; mov eax ebx might not mean the same thing to both encodings.Beetle
@bionicOnion: I don't see a problem with backwards compatibility. The binary code 89 d8 in 0/1 bits would stay the same in trits, but you get a lot more opcodes where any one of these 16 trits can be -1. And those are not the same opcode.Englishism
whta is the memory speed aspect?Edomite
@RadLexus I would assume he's looking at the hardware aspect, not the software aspect. A ternary processor, or at least an early one, would likely have distinct binary and ternary modes, and would need to switch between them. This would incur some overhead, even if it may not be much. Additionally, depending on how it's designed, the process to move data into a ternary register may very well be different from the process to move data into a binary one; if so, we would lose the guarantee that mov eax, ebx always performs the same process.Caddaric
"Ternary is the integer base with the highest radix economy, followed closely by binary and quaternary" This is a moot point since all ternary data stored over binary media suffers a radix loss due to a medium impedance mismatch. Unless the entire system is ternary, there is no gain and only a net loss.Immigration
Furthermore, radix economy itself is a bit of a misnomer since the multiplexing of digital data effectively covers the same states as ternary processing over the existing binary framework. Analog has the greatest radix economy and for that we now use digital with analog-to-digital converters. Ternary systems and software is also incredibly wasteful since the states are often stored as both ternary (over binary) and binary. Just look at some current ternary projects in the software field ... trits are stored over ints (wasting 4 bytes for every 1,0,-1.Immigration
Lastly, the idea that a numerical radix economy exists over fibre-optic is false. Fiber optic hardware is also not subject to the same 'radix economy' since digital signals are subject to several levels of multiplexing - including but not limited to wavelength-division multiplexing.Immigration
V
18

Of course we'd be able to hold more data per bit, just like our decimal number system can hold far more data in a single digit.

But that also increases complexity. Binary behaves very nicely in many cases, making it remarkably simple to manipulate. The logic for a binary adder is far simpler than one for ternary numbers (or for that matter, decimal ones).

You wouldn't magically be able to store or process more information. The hardware would have to be so much bigger and more complex that it'd more than offset the larger capacity.

Violette answered 18/4, 2009 at 23:19 Comment(21)
Does that come from actual experience designing hardware or simply a gut instinct?Suspire
ojblass: It comes from people actually making decimal computers in the 1940s onwards. There are also ternary logic gates around, but very few ternary computers. See for example Wikipedia's article on the history of computing hardware: en.wikipedia.org/wiki/History_of_computing_hardware,http://…, and en.wikipedia.org/wiki/Ternary_computerGirhiny
By definition the logic for trits is more complicated than bits. In binary, if you have two bit inputs, you have 2 * 2 == 4 outputs. With ternary, you have 3 * 3 + 9 outputs.Overpowering
@James: computers are complicated one way or another ;v) , see en.wikipedia.org/wiki/Radix_economy#Radix_times_required_digits for background on the studies that led early engineers to decide on binary.Inappetence
@Inappetence thanks for the link to the article, but it supports the idea that ternary is more efficient overall (radix 3 is 58% more efficient). The only reason there provided was noise immunity from voltage fluctuations, which is honestly a good reason, especially during the early days of computing. Less so now though...Gnotobiotics
@IsaacKotlicky Noise immunity is as important as it ever was. As long as you somehow use voltage levels, the margin between them translates directly into time and energy.Inappetence
@Inappetence true, but that's primarily relevant to unbalanced ternary, not balanced.Gnotobiotics
@IsaacKotlicky It's the same. I'm talking about electrons, not numerals. Levels of 0V, 1V, and 2V are physically the same as levels -1V, 0V, 1V. Selecting a different ground voltage is merely a change in convention.Inappetence
@Inappetence now you've confused me... The ground voltage in both binary and balanced ternary is 0. The line flux is likely to be LESS of a problem when you're straddling 0 rather than some point between 0 and 1...Gnotobiotics
@IsaacKotlicky Ground is by definition zero volts in circuit theory, but it is only an arbitrary reference point. Whatever voltage you choose as ground, the circuit will work the same way. Balanced ternary is a place-value number system and it has no bearing on electrical signaling.Inappetence
@Inappetence Ternary can very well be based on electrical signaling. The Josephson junction purposed memory circuit uses directional current to determine value. So clockwise=1, cc=-1, and off=0 (obviously). This has further advantages over simple place value ternary.Gnotobiotics
It should be noted that @Inappetence confused voltage and potential. Voltage is a difference in potential, and is absolute, not based on an arbitrary reference point. The term is ground potential, not ground voltage. It does make sense to have -1, 0, and +1, and it's not the same as 0, 1, and 2.Goggle
@Goggle Microchips and other logic circuits are always electrically isolated. “Ground” and “positive supply” references are in practice equally immune to noise and capable of supplying current. In circuit theory, they are ideal voltage supplies. Physically, they come from an artificial power brick which protects against phenomena of the outside world.Inappetence
@Inappetence Voltage is simply a subtraction. A change in reference point doesn't matter, because it cancels out in the subtraction. You are talking about potentials again, not voltages. Ground is not a voltage supply, as it can't create a difference. You need to pair it up with something else to have a source. A battery is a voltage source, pairing two potentials to form a difference. Voltage sources are necessarily pairs of points. en.wikipedia.org/wiki/Voltage_sourceGoggle
@Goggle Yes. What's your point? Where was I confused? Now you seem to be saying that -1, 0, and +1 are physically equivalent to 0, 1, and 2 which contradicts your earlier message.Inappetence
@Inappetence They are not equivalent. A voltage of -1 says that one potential is higher than the other, and a voltage of +1 says that the other is higher than the one. The direction of flow of electrons depends on the sign of the voltage. "A change in reference point doesn't matter" means that, no matter the reference point, -1 is always -1.Goggle
@Goggle What do you think these numbers signify? The difference between -1 and +1 is 2. A digital circuit physically depends on having fixed potential reference points — two for binary and three for ternary. Electrons may flow from any potential level, through a logic gate, to any other level. Labeling the nodes as 0, 1, and 2 does not imply that current cannot flow from 2 back to 0 or vice versa. (If that's the assumption you're bringing… it's very unclear.)Inappetence
@Inappetence -1V is itself the difference. It signifies a difference in potential between two points. On a diode, it signifies the difference in potential between its two ends. Actually, the existence of a diode itself shows how -1V, 0V, +1V can't be shifted to 0V, 1V, 2V. A diode only allows power to flow in one direction, so the difference between positive and negative voltage matters.Goggle
@Inappetence A binary computer uses potential difference (voltage), not potential, as signals for 0 and 1. A balanced ternary computer would also use potential difference, not potential.Goggle
@Goggle No: and maybe this is your point of confusion. The DC power supply maintains a fixed potential difference between two (or three) nodes, which are distributed throughout the circuit to every gate. Then, gates compute logic functions in internal nodes by selectively connecting them to the power nodes. At equilibrium, every node throughout a binary digital circuit is at one of two potential levels. In ternary, the same is true of three levels.Inappetence
@Inappetence I'm not the one confused. Modern logic gates work through transistors, and transistors, like diodes, work through potential difference (voltage), not potential. The measurement of voltage is independent of a reference point for potential. (x+P) - (y+P) is independent of P. If you change the ground potential without changing the potential of the other end, the computer won't work, because it's about the difference. Both -1/0/+1 and 0/1 refer to potential difference, not potential.Goggle
C
13

A lot of it has to do with the fact that ultimately, bits are represented as electrical impulses, and it's easier to build hardware that simply differentiates between "charged" and "no charge", and to easily detect transitions between states. A system utilizing three states has to be a bit more exact in differentiating between "charged", "partly charged", and "no charge". Besides that, the "charged" state is not constant in electronics: the energy starts to "bleed" eventually, so a "charged" state varies in actual "level" of energy. In a 3-state system, this would have to be taken into account, too.

Croix answered 18/4, 2009 at 23:19 Comment(5)
Actually, I think most ternary logic uses +1, 0, and -1 states, not 0, +0.5, and +1.0 states.Awad
Well whatever most means... but I imagine it is as easy to detect the differences between +1 and 0 as it is between -1 and 0.Suspire
Try writing code that distinguishes three values using only one if statement. (no case allowed)Bloemfontein
can i make up a language construct?Suspire
@IfLoop Are you referring to Fortran's Arithmetic If?Reamy
B
10

There are also theories that suggest that fiber optics could use light frequencies (i.e.color) to differentiate states thereby allowing a near infinite (depending on resolution of the detection unit) number of base possibilities.

Logic gates are definitely feesible for any base but let's use trinary for an example:

For a trinary XOR gate, it could be exclusive to one (or any) of the three states it is comparing OR one of the other three states. It could also tie two of the three states together for a binary output. The possibilities increase literally exponentially. Of course, this would require more complex hardware and software but the complexity should decrease the size and more importantly the power (read heat). There is even talk of using trinary in a nano computing system where there is a microscopic "bump, a "hole" or "unchanged" to represent the three states.

Right now, we are in sort of a QWERTY type problem. Qwerty was designed to be inefficient because of a problem with typing mechanics that no longer exists but everyone who uses keyboards today learned to use the qwerty system and no one wants to change it. Trinary and higher bases will someday break through this issue when we reach the physical limitations of binary computing. Maybe not for another twenty years but we all know that we cannot continue doubling our capability every year and a half forever.

Berkman answered 8/9, 2011 at 22:10 Comment(1)
Agree. Nowadays, with emojis we have some sort of QWERTY+, i guess. That's in natural languages communication. It seemed weird then. Now it either saves time when typing or even expands the context or both at the same time.Geminate
B
7

Well, for one thing, there is no smaller unit of information than a bit. operating on bits is the most basic and fundamental way of treating information.

Perhaps a stronger reason is because its much easier to make electrical components that have two stable states, rather than three.

Aside: Your math is a bit off. there are approximately 101.4 binary digits in a 64 digit trinary number. Explanation: the largest 64 digit trinary number is 3433683820292512484657849089280 (3^64-1). to represent this in binary, it requires 102 bits: 101011010101101101010010101111100011110111100100110010001001111000110001111001011111101011110100000000

This is easy to understand, log2(3^64) is about 101.4376

Bloemfontein answered 18/4, 2009 at 23:18 Comment(4)
2 to the 6 is 64 and 3 to 6 is 729... I am sorry am I being dense?Suspire
You are right of course... my head hurts but you are right... can you correct the question in some meaningful way to say that?Suspire
Regarding "ts much easier to make electrical components that have two stable states, rather than three", is it likely to change in the more modern future?Marrymars
@Pacerier: not that I'm aware of, but then I'm not an expert. That's probably a question for physics.stackexchange.comBloemfontein
P
3

I believe it is for two reasons (please correct me if I'm wrong): first because the value of 0 and 1 is not really no-current/current or something alike. The noise is quite high, and the electronic components must be able to distinguish that a value fluctuating from, say, 0.0 to 0.4 is a zero, and from 0.7 to 1.2 is a one. If you add more levels, you are basically making this distinction more difficult.

Second: all the boolean logic would immediately cease to make sense. And since you can implement sum out of boolean gates, and from sum, every other mathematical operation, it is nicer to have something that maps nicely into practical use for math. What would be the boolean truth table for an arbitrary pair between false/maybe/true?

Potentiometer answered 18/4, 2009 at 23:26 Comment(3)
Well... Actually boolean truth table is just a special case for number of values=2. You can define ternary logic just as easily en.wikipedia.org/wiki/Ternary_logic To make it more interesting Z/high impedance state is actually used in every standard computer / electronic device to implement buses that can handle more than multiple devices on one line.Demonstrator
I disagree with wikipedia's satement that Z is a logic state. You cannot in the real world use Z in all operations. How would one build an XOR gate that works with Z?Finned
You absolutely can use Z in all logic gates. Binary has 16 theoretical two-input gates, one of which is named XOR. Ternary has 19,683 theoretical two-input gates, 243 of which produce the same results as XOR for 0/1 inputs. Take your pick.Bunnybunow
I
3

Screwball's reply is correct and corrects some of the misstatements offered here. Those who replied about fractional positive values completely missed the concept of the ternary system which is based on 0, +1 and -1. When first constructed by the Russians in the 1950's, the competition between USSR and USA was intense. I suspect that politics between the two had a lot to do with the USA's binary's eventual popularity over the USSR's ternary.

From what I've read, there are some ternary computers in use. Moscow has some in use at their university and IBM has some in its labs. There are references to others, but I couldn't distinguish how serious they are, or if they are just for experimentation or play. Apparently they are much less costly to build and they use far less energy to operate.

Inferno answered 31/12, 2012 at 15:5 Comment(2)
I can't find any reference to the computers "in use". They're all in museums or ancient toys for universities. None build within the last 40 years.Bunnybunow
@MooingDuck, it's time to change it! Make ternary great again!Geminate
C
1

Another major hurdle is that there are a much larger number of logic operations that would need to be defined. The number of operators is found by the formula b^(b^i) where b is the base and i is the number of inputs. For a two input binary system this works out to 16 possible operators. Not all of this are usually implemented in gates and some gates cover more than one condition, however all of them can be implemented with three or less of the standard gates. For a two input ternary system this number is much higher about 19683. While several of these gates would be similar to one another, ultimately the ability to design basic circuits manually would be almost impossible. While even a freshmen engineering student is able to design basic binary circuits in their head.

Crackbrained answered 24/3, 2011 at 3:56 Comment(2)
Please, explain why the number of operators is b^(b^i)Escarp
Designing basic circuits isnt harder in ternary than binary. Ternary has 19,683 theoretical two-input gates, but in practice I expect you only need about 9 of them to make functional circuits. Binary 16 in theory, but most of the time we only use ~4.Bunnybunow
E
1

If we use 3 states, then the main problem arising due to this are

  1. If we use unipolar signal then the noise margin will reduce, hence increasing the bit error rate.
  2. For unipolar signal to keep the noise margin constant we have to increase the power supply and hence the power consumption will increase.
  3. If we use bipolar signal then the total swing of the signal will increase thereby increasing the losses.
  4. Extra layer in multilayer PCB will have to be added to account for negative swing in the bipolar signals.

Hope i am convincing

Exogamy answered 5/2, 2014 at 15:39 Comment(1)
notably, ternary also requires fewer gates/cells/etc, but not quite enough fewer to compensate for the increased power-per-trace.Bunnybunow
A
0

I think that ternary would be more efficient. It just never became popular. Binary took the stage and now a switch to ternary would be a change of everything we know.

Alizaalizarin answered 16/2, 2011 at 3:59 Comment(1)
Definitely not "just more popular" on the hardware level: assuming that a simple binary logic gate has +1V defined as 0 and +5V defined as 1, the actual voltage will be somewhere in the vicinity - e.g. it could be +2V and +3.5V, yet still operate properly: in this case, there is still a reasonable gap to distinguish between a high and low state; for ternary, you'd have to a) have tighter operating (and by extension,manufacturing) tolerance, leading to more expensive iron, and/or b) work with higher voltages (e.g. +1/+5/+9V), which again has its own engineering pitfalls (thus again costs more).Massotherapy
M
0

A lot of it has to do, I am pretty sure, with error checking of digital signals. For example, in quantum computing this task is nearly impossible, but not impossible, to achieve do to the non-cloning principle, but also due to the fact that there are an increased number of states. For two states the process of error checking is not trivial, but it is relatively easy. For three states error checking becomes infinitely harder. This is also why analogue computers with an nearly infinite amount of states were ruled out.

If you are interested in Quantum Computing though look into sphere packing and quantum error checking, some pretty neat stuff there.

Marika answered 28/2, 2011 at 16:27 Comment(2)
As a little update on this question. I am actually thinking about trying to implement a very basic FPGA based ternary computer one day.Marika
How it's going?Geminate
M
0

To have a circuit operate in anything but binary, you must define how the other states will be represented. You've proposed a system of -1, 0, and +1, but transistors don't work that way, they like to have their voltage or current going in one direction only. To make a 3-state bit would take 2 transistors, but you could make 2 binary bits out of the same transistors and have 4 states instead of 3. Binary is just more practical at the low level.

If you tried to set thresholds on the circuit and use 0, +1, +2 instead, you run into a different set of problems. I don't know enough to go into details, but for logic circuits it's just more trouble than it's worth, especially when the industry is completely dedicated to binary already.

There is one area where multiple levels are used to get more than 2 states per bit: MLC flash memories. Even there the number of levels will be a power of 2 so that the output can be easily converted to binary for use by the rest of the system.

Monadism answered 8/9, 2011 at 22:32 Comment(1)
You're not mistaken but seem to apply work-with-what-we-have approach, e.g. using transistors we currently have and not creating completely different, truly ternary.Geminate
E
-1

Sure but a ternary 'bit' (a tet?) would be more complicated, you'd still be storing the same amount of information, just in base3 instead of base2, and the power if two-state components is the simplicity. Why not just go ahead and make a 10-state base10

Binary computing is related to binary AND, OR and NOT gates, their immense simplicity and ability to be combined into arbitrarily complex structures. They are the cornerstone of literally all the processing your computer does.

If there was a serious case to switch to ternary or decimal then they would. It isn't a case of 'they tried it like that and it just stuck'

Eaton answered 30/11, 2012 at 2:0 Comment(2)
Side note: It's a 'trit', from trinary digit.Analgesic
Side note #2: you'd actually be able to store more in a trit than a bit. For signed values, a trit could hold binary's 1 and 0, but also -1 without the need for a sign bit. For unsigned, a trit could hold 0, 1, and 2. Binary would require 2 bits to equate. And in the case of a deca system, you'd be able to hold an immense amount of information over a bit or even a trit.Keratosis
V
-2

I think it has more to do with programmability, conditional statements and the efficient use and functionality of transistors than anything else. It might be obvious that a nested IF is true if there is a current through a circuit, but how would a program know what to do if the solution could be achieved by a thousand different routes? It's interesting in regard to AI, where memory and learning are far more important than brute computational power.

Volsci answered 24/3, 2013 at 21:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.