3 ms·
How do you propose to design physical gates that would handle ternary logic, in a way that is more efficient than the current boolean implementation?
by alain94040 6y ago
How do you propose to design physical gates that would handle ternary logic, in a way that is more efficient than the current boolean implementation?
- anonymousiam 6y agoGood question. After thinking about it for 30 seconds, I would say add a negative power rail go from there. All gates are analog circuits at the lowest level, so it would not be very difficult to come up a circuit design. I think the main obstacle would be the lack of ternary logic designers. VHDL/Verilog could probably be extended/enhanced to support ternary logic, but there would be a learning curve for the designers.
- theamk 6y agoI don't think that the problem is with the lack of designers. There are companies making specialized chips all the time, so if there were a way to create an efficient ternary circuits, then someone would have made one. For example, AI/neural networks do not care about base (they just need math), and they only need a few types of cells to be useful. But I have not heard of any applications of ternary there. Intuitively, I assume we'd still want to drive transistors to saturation, so we are not dependent on process parameters. Which means that each transistor still only handles two states, and we need two transistors for each trit. But if we have two transistors, we might as well use them for 2 bits and get even more state out of them.
- deleted 6y ago[deleted]
- tyingq 6y agoNot claiming it's efficient, but here's a description of how the Z80 does tri-state output: https://baltazarstudios.com/anatomy-z80-gate/ https://baltazarstudios.com/anatomy-z80-gate/ I'd be curious how modern fpgas do it.
- theamk 6y agoModern FPGAs do it pretty much the same -- there are high and low drivers, and one of them gets activated at a time. Note that this link is tri-state, not ternary. The "tri-state" is still binary, the third state is to allow attaching multiple outputs to the same bus. Or in the C pseudocode: Regular binary: enum { FALSE, TRUE } value; value = result() Ternary: enum { UNKNOWN, FALSE, TRUE } value; value = result() Tri-state (as Z80 and every modern computer does it): enum { FALSE, TRUE } value; if (enabled()) value = result() (the idea is you might have multiple components driving the same "value", and only one of them should be enabled at a time. Bad things happen if more than one is enabled at a time, or none are)
- tyingq 6y agoThat's helpful, though googling around a bit suggests both the Z80 (and popular peripheral chips) and FPGA/CPLD devices do have non-bus, single pin abstractions that can output and input 3 states with a single pin. But replicating that with an ATMEL or similar generally requires dancing around with resistor ladders or similar.
- theamk 6y agoCan you tell me more about how can Z80 (or popular peripheral chips) "can output and input 3 states with a single pin"? Or maybe give some web links? I am pretty familiar with that chip, so hearing this surprises me. For the output side, I guess I you can tri-state the output, but this will by default keep the previous voltage, you will need some resistors to actually emit a voltage outer than "low" or "high". And Z80 cannot even control this on per-pin basis, since it has no integrated GPIOs. For the input side, I have no idea how would Z80 get more than two states. All the peripherals I know of (like 82C55 GPIO chips) also only provide two input levels as well. The only way to get 3-state input into a system I can think of are: - ADC input followed by software thresholding (this will be pretty slow, and works with hundreds of states, not just 3) - Use external voltage comparators to split a single input wire into multiple input pins. This no long is "single pin" though. - Some FPGA/CPLDs have multiple banks with changeable input thresholds. This lets you avoid external comparators. You'd still need multiple pins for each input wire.