AND gate that uses trinary logic

WBahn

Joined Mar 31, 2012
32,874
What's a "digit"? not being facetious, just getting clarity.
The term "digit" refers to a single character in a positional number system, which can take on one of B values (represented by B distinct symbols) in a base-B numbering system. The term itself is base-agnostic.

In everyday colloquial conversation, we often infer that 'digit' refers to what is more properly called a 'decimal digit'. That is why it is important to distinguish this by referring to base-2 digits as 'binary digits', which is so common that we use the shorthand 'bit' for it.

We also commonly use 'hexadecimal digits', which we shorten to 'hex digit'. Since 'hits' is probably not a wise choice, we could probably shorten it further to 'hexits', but neither that, no anything else that I'm aware of, has caught on that is a direct shortening of the name. That's probably because, separately, we started using 'byte' as a 'bunch of bits' (deliberately a misspelling of 'bite' and based on the notion that, in English, a 'bit' can imply a small bite) and, from there, a 'nibble' as being something between a bit and a byte. The 'byte' was originally whatever the natural data path of a processor was, and so it varied a lot (something like 1 to 48 bits) before finally being fixed at 8 bits, driven primarily by the IBM System360 architecture. A nibble, on the other hand, has always referred to exactly four bits (with a few rare exceptions, such as the early Apple II disk encoding) because it arose naturally as representing half of an 8-bit byte and represented using a single hexadecimal digit.
 

MisterBill2

Joined Jan 23, 2018
27,563
My challenge presented in my post #18 still stands. And I am not even asking for a circuit. The logic math will be horrible and not at all efficient.

The obvious alternative to binary computing is analog computing.

Presently "analog computing" is done by digital computers using simulator software. Such as SPICE.
 

Ian0

Joined Aug 7, 2020
13,132
There's one useful thing you can do with ternary logic and that's drive a weighted-resistor D/A. If you drive it with processor pins that can be tristated you can get 81 levels from 1k,3k, 9.1k and 27k resistors.
 

meth

Joined May 21, 2016
304
A "two digit adder" would produce the binary representation of 2+3=5 in a binary format: 0100 + 0010 =1010
Sorry but the equations are nowhere near correct :D (offtopic).

I would not even think of using trinary logic for anything. Maybe some isolated case where a circuit would have only one purpose and the inputs somehow have to be 3-state signals. I totally agree with the adder challenge.
 

Ian0

Joined Aug 7, 2020
13,132
I also think it would be less easy to produce an output voltage that is equal to neither of the supply voltages without consuming power.
 

Thread Starter

Futurist

Joined Apr 8, 2025
765
I have returned.
I suggest trying to create one of the early digital modules with the base-3 logic. That would be a two digit adder. OR, much more challenging, a FOUR digit adder. An adder was the first example in the first logic training book I ever studied. And if a system can't produce an adder then it probably probably has a serious limitation.
He discusses trinary adders in some detail here:

https://homepage.cs.uiowa.edu/~dwjones/ternary/arith.shtml
 
Last edited:

MisterBill2

Joined Jan 23, 2018
27,563
Binary arithmetic has always seemed to me as quite tedious. Fortunately the control circuits I designed and dealt with did not require binary math. Binary logic but not addition or multiplication.. Any required math was deep inside the IC logic.
 

panic mode

Joined Oct 10, 2011
5,000
it is an interesting concept, specially in light of reduced power consumption. i only thought of it as academic concept, but apparently, there was a working system decades ago. and now there is a first silicone chips from HUAWEI that uses the idea. they made not just the chip but eco system showing performance leaps. binary computing made incredible strides but with every passing year there are new and harder challenges. it only makes sense that people are looking at alternatives and trying to exploit them


 

MisterBill2

Joined Jan 23, 2018
27,563
OK, so there actually exists a working trinary system. The only things standing in the way of it being accepted are the microsoft giant and the massive installed base of binary based computer systems. That is a situation like the battle between VHS and the BETA format video tapes. There, the best did not win but the fastest did win.
With computers it was windows versus LINUX. IfI had been able to get and study a LINUX manual I never would have touched that MS product. (Sort of off topic, my apology)
 

Thread Starter

Futurist

Joined Apr 8, 2025
765
OK, so there actually exists a working trinary system. The only things standing in the way of it being accepted are the microsoft giant and the massive installed base of binary based computer systems. That is a situation like the battle between VHS and the BETA format video tapes. There, the best did not win but the fastest did win.
With computers it was windows versus LINUX. IfI had been able to get and study a LINUX manual I never would have touched that MS product. (Sort of off topic, my apology)
Programming languages are abstractions of a computer, I'm sure most languages would change little. Just because the internal hardware changes, no reason to abandon existing concepts.

It strikes me that 4 states (quaternary) would be the holy grail, totally compatible with binary (they are each powers of 2) just 4 "quits" can represent exactly the same number of states as 16 bits. An 8 quit bus could carry the same state data as a 32 bit bus.

One can envisage existing instruction sets being unchanged by the move from binary to quaternary, identical, only the electrical representation changes.

The idea is hardly new, recall the (often forgotten) difference between baud rate and bit rate.
 
Last edited:

Ian0

Joined Aug 7, 2020
13,132
Bits with four levels would fit more easily with existing conventions as one bit would just map to 2, but that would really trash the noise immunity.

Did anyone else understand how they had created a transistor with two thresholds?
 

MisterBill2

Joined Jan 23, 2018
27,563
Bits with four levels would fit more easily with existing conventions as one bit would just map to 2, but that would really trash the noise immunity.

Did anyone else understand how they had created a transistor with two thresholds?
The main thing is that it is not clear what problem it would address. What would it solve or improve??? AND I seriously question that it could reduce power consumption, as a trinary scheme will have TWO non-zero states instead of only one.
 

WBahn

Joined Mar 31, 2012
32,874
The main thing is that it is not clear what problem it would address. What would it solve or improve??? AND I seriously question that it could reduce power consumption, as a trinary scheme will have TWO non-zero states instead of only one.
The main problems it would address would be device count, density, and interconnect routing. The power issue is thornier and would come down to the details. Overall power consumption might be less even if Individual devices consume more due to the lower total device count. Or maybe not. With more fundamental logic functions available, processing speed might also be faster, at least for some applications, because of needing fewer layers of processing. Though this would depend on the relative speed of ternary gate compared to its binary counterpart.

The utility really comes down to the logical interpretation of that third state -- or perhaps a complete reassessment of all three states -- and how they can be applied to logical operations.
 

Thread Starter

Futurist

Joined Apr 8, 2025
765
The main problems it would address would be device count, density, and interconnect routing. The power issue is thornier and would come down to the details. Overall power consumption might be less even if Individual devices consume more due to the lower total device count. Or maybe not. With more fundamental logic functions available, processing speed might also be faster, at least for some applications, because of needing fewer layers of processing. Though this would depend on the relative speed of ternary gate compared to its binary counterpart.

The utility really comes down to the logical interpretation of that third state -- or perhaps a complete reassessment of all three states -- and how they can be applied to logical operations.
I'm curious W, you mentioned "meaning" several times when commenting on this, but this is just a number base, does binary have meaning that decimal does not?
 

WBahn

Joined Mar 31, 2012
32,874
I'm curious W, you mentioned "meaning" several times when commenting on this, but this is just a number base, does binary have meaning that decimal does not?
Arithmetic and logic are two very different things.

In Boolean logic, the two states mean "TRUE" and "FALSE" in the formal logical sense -- an assertion is either TRUE or it is FALSE. The logical operators are based on the logical relationships of those two concepts.

When representing numbers in binary, there is no TRUE or FALSE concept, only symbol manipulation. It is merely a positional number system representation that translates the abstract concept of a number into a sequency of symbol. We then implement processing routines that manipulate those symbols according to the arithmetic rules the govern the operations on the numbers being represented. Once we determine what the symbol manipulations need to be, we look at the logic operations available to us and pick the ones that perform the task regardless of any TRUE/FALSE aspect.

The same would be true in any other logic system. In ternary logic, we will have a set of logic operations that are defined. We don't need to know what those operations mean from a ternary-logic standpoint in order to use them to manipulate the trits in order to implement arithmetic operations according to how we choose to represent numbers using trits. But for logic operations, we would need to know what the three states mean and what our logical operators mean when acting on them.
 

Ian0

Joined Aug 7, 2020
13,132
If the third state is an intermediate voltage between the two power supplies, it seems as though it would be difficult to output that voltage at a low impedance without consuming a standing current. (like an op-amp with dual supplies, outputting zero)
Alternatively, would it need 3 power supplies? Positive negative and ground?

A lot of processing consists of tests for TRUE or FALSE, e.g is A>B, is C==9 etc. That seems entirely suited to binary. Having a third state for the output of such comparisons seems superfluous. Possibly it could do two comparisons at once, but that would require four states to output the result, not three. There are just a few comparisons where a variable is compared to two constants where three output states might be useful.
 

Thread Starter

Futurist

Joined Apr 8, 2025
765
If the third state is an intermediate voltage between the two power supplies, it seems as though it would be difficult to output that voltage at a low impedance without consuming a standing current. (like an op-amp with dual supplies, outputting zero)
Alternatively, would it need 3 power supplies? Positive negative and ground?

A lot of processing consists of tests for TRUE or FALSE, e.g is A>B, is C==9 etc. That seems entirely suited to binary. Having a third state for the output of such comparisons seems superfluous. Possibly it could do two comparisons at once, but that would require four states to output the result, not three. There are just a few comparisons where a variable is compared to two constants where three output states might be useful.
But true/false has meaning quite distinct from binary. The expression 123 > 45 is true whether the numbers are ultimately base 2 or base 10.

Boolean algebra is predicated on two states, one could devise a consistent comparable algebra based on 3, 4 or any number I suppose.

https://scispace.com/pdf/kleene-s-three-valued-logics-and-their-children-3k7rirgu2l.pdf
 

Ian0

Joined Aug 7, 2020
13,132
True/false might not be identical to binary, but it maps very nicely on to binary for storage.
The two states in Boolean algebra (true/false) are complementary. There can be no third state which is neither true nor false, perhaps in philosophy, but not at the level microprocessors work at.
 

WBahn

Joined Mar 31, 2012
32,874
True/false might not be identical to binary, but it maps very nicely on to binary for storage.
The two states in Boolean algebra (true/false) are complementary. There can be no third state which is neither true nor false, perhaps in philosophy, but not at the level microprocessors work at.
But we use non-binary states for storing digital data all the time. The most common place is in Flash memories, which today can store up to 4-bits of data per cell by using transistors that have 16 different possible threshold values. The use of multi-level cells goes at least as far back as the Intel 8087, which used ROM cells that could be in one of four states, thus holding two bits per cell.

Designing processors that work directly on multi-level logic is not unreasonably difficult. It's a question of whether the benefits outweigh the drawbacks. In SSDs, the answer is yes, because we want cheap drives with extremely high capacity. So we use Triple-and Quad-Level cells because the downsides in performance and reliability are tolerable and surmountable via parallelism and very strong error-correcting codes.
 
Top