1
\$\begingroup\$

I am thinking of creating a ternary computer from scratch, mostly as a hobby project, are there any parts out there that I could use? Or would I have to create them from scratch? If so, what would be a good method?

I was thinking of a balanced Ternary system, much like Nikolay Brusentsov's Setun. I am familiar with VHDL and I am quite familiar with Binary logic. I was hoping to avoid using digital components, such as FPGAs and make a purely ternary computer, so I was thinking more of what to use a logic units, in lieu of transistors.

\$\endgroup\$
6
  • \$\begingroup\$ Search for "HDB3". It's a ternary encoding scheme common in telecommunications. Never seen a computer made that way but you might find some useful information, maybe parts or example circuits. \$\endgroup\$
    – user16324
    Commented Jun 24, 2014 at 16:02
  • 6
    \$\begingroup\$ Why do you want a ternary system? How much binary logic design do you know? What functions do your ternary logic gates implement? Do you know why nobody uses ternary logic? \$\endgroup\$
    – pjc50
    Commented Jun 24, 2014 at 16:11
  • \$\begingroup\$ Further to Brian's comment, I have had HDB3 test gear open and it's almost all 74 series logic inside, presumably 33% more than would otherwise be required for a binary system. HDB3 is of course like that for a purpose (reliable communications), if you can answer pjc50's question then you're half way to solving whatever your problem may be. \$\endgroup\$
    – John U
    Commented Jun 24, 2014 at 16:19
  • 1
    \$\begingroup\$ Most of the research in ternary computing, to my knowledge, was done by the Russians, and likely remains untranslated to this day. If you're dead set on this, you may be able to dig up some of their old work. It may be of use, even if you don't understand Russian. Electronics and math should remain the same, regardless of language. \$\endgroup\$ Commented Jun 24, 2014 at 17:23
  • 1
    \$\begingroup\$ What's your issue with transistors (if they could be setup in a balanced ternary fashion)? \$\endgroup\$
    – horta
    Commented Jun 25, 2014 at 15:33

4 Answers 4

3
\$\begingroup\$

A PMOS over a NMOS would work as a ternary inverter if the supply voltage is low (slightly above the threshold voltage):

schematic

simulate this circuit – Schematic created using CircuitLab

At -0.5V input, the output will be raised by M2 to 0.5V.
At 0V input, both transistors will be "Off" and the resistors will pull the output back to 0V.
At 0.5V input, M2 will shut off and M1 will turn on pulling output to -0.5V.

A Ternary NOR could be this:

schematic

simulate this circuit

Truth Table:

00 0
0+ -
0- +
+- 0
++ -
-- +

A Ternary NAND could be this:

schematic

simulate this circuit

Truth Table:

00 0
0+ 0
0- 0
+- 0
-- +
++ -

I would assume more complicated ternary gates could be made based on similar principles.

It's interesting to note that a major disadvantage of this topology is the loss of speed due to RC settling times where the C is inherent capacitance of the transistors. One possible advantage of this may be the required low-voltage and therefore low power draw of the circuits.

\$\endgroup\$
3
  • 2
    \$\begingroup\$ @Owl_Prophet I added a NAND and a NOR gate that should operate in ternary. I also found a fantastic summary of Ternary ALU architecture once you get to that point: homepage.cs.uiowa.edu/~jones/ternary/arith.shtml#lookahead \$\endgroup\$
    – horta
    Commented Jun 25, 2014 at 19:56
  • 1
    \$\begingroup\$ That's fantastic! If I could upvote this comment, I would so hard... \$\endgroup\$ Commented Jun 25, 2014 at 20:02
  • 1
    \$\begingroup\$ @Owl_Prophet Found another article on ternary multiplication. As a plus, it also has a faster resistor-less implementation for ternary inversion: hjem.ifi.uio.no/~henningg/docs/h_gundersen_norchip06.pdf \$\endgroup\$
    – horta
    Commented Jun 25, 2014 at 22:03
0
\$\begingroup\$

You're not going to find any logic ready-made. However, you can build up your own logic using an FPGA. I'd try mapping 2 binary bits to a single ternary bit by mapping 11 to 1, 10 or 01 to unknown, and 00 to 0. Then you would define your ternary logic operations on sets of these two bits. Likewise, for instance, you could then use existing memory at half data width, that is an 8-bit-wide RAM would be used as a 4-bit-wide ternary RAM, etc. You'll need to become proficient with VHDL for the design process, or if you like you can get a schematic entry option for FPGA design.

\$\endgroup\$
1
  • \$\begingroup\$ Verilog is another option, but you knew that. \$\endgroup\$ Commented Jun 25, 2014 at 18:12
0
\$\begingroup\$

I'm dredging up a really old post here, but my answer was voltage comparators (not binary comparators). My project thus far is documented at https://hackaday.io/project/6284-tern-physical-implementations-of-ternary-logic

\$\endgroup\$
0
\$\begingroup\$

Recently I realized a prototype of Ternary Balanced Electronic Calculator (TBEC) based on three locgic levels -1, 0, 1 (trit). It consists of an 8 trit ternary memory made with ternary Flip-Flop D-latch, 3 ternary Full-Adder and one ternary Half-Adder, and finally by a ternary decoder which allows you to view the addenda of the operation (4 trit + 4 trit) and the result (5 trit) on LEDs. The management of the keyboard (1 ternary digit), the enabling of the memory and the decoder is managed through a PIC microcontroller. the device is schematized in the following figure:

enter image description here

I later improved the project interfacing the TBEC with a common PC. As previously said, each addendendum is made up of 4 trit, so the Calculator can process numbers ranging from -1-1-1-1 to 1111 (-40 to 40 decimal places) and give a result from -10001 to 1000-1 (-80 to 80 decimal places). From now on for convenience we will denote -1 as 2.

For this reason, the PC transmits to the TBEC unit for each addend two numbers, the first of which constitutes the quantity of quarantines into which the addend is decomposed and the second the remainder of the difference between the value of the addend and the quantity of quarantines in which the latter is decomposed

ADD1 = n40 * 40 + R1
ADD2 = n40 * 40 + R2
Where R 1= ADD1 – n40 * 40
R 2= ADD2 – n40 * 40

Once received the four numbers constituting the addenda, the ternary unit performs the sum respectively of the quantities of quarantines and the remainders and returns it to the PC. For example, if you want to add 85 + 41, 0012, 0122 will be transmitted to be added to 0001, 0001, obtaining 00010, 00120 in reception.

The memory made up of eight ternary flip-flops D latch stores the two addenda to be presented to the adder.

As we said at the beginning, the PC communicates with the TBEC unit through a UART serial protocol, whereby the information travels in byte packets. Hence the need to encode the ternary number from 2222 to 1111 through the eight bits of each single packet, therefore two bits are required for each trit as follows: 0 <=> 00, 1 <=> 01, 2 <= > 10

In the above example 0012 is encoded in one byte as 00.00.01.10. 0122 is encoded in one byte as 00.01.10.10

The result at the adder output is on five trit so it needs a coding on two bytes: 00010 is transmitted as 00.00.00.00 00.00.00.10 00122 is transmitted as 00.00.00.00 00.01.10.10

enter image description here enter image description here

YOUTUBE VIDEO https://youtu.be/PmED4PfKZgc

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.