r/computerscience • u/Xulum12 • Feb 23 '25
I designed my own ternary computer
So I pretty much realised I will never have enough money to build this, and no school or university will accept my proposal (I'm in 11th grade and yes, I tried.) So I will just share it for free in the hopes of someone having the resources to build it. I tried to make the divider circuit too, but tbh, I just lost the willpower to do it since the realization. So here are the plans. Some of it is in Hungarian, but if you understand basic MOSFET logic, you will figure it out. I tried to make it similar to binary logic. From now on, I might just stop with designing this. The pictures include an adder, multiplier, some comparator circuits, and a half-finished divider. The other things (like memory handling, etc) are pretty easy to implement. It is just addressing. I have some other projects, like simulating a mach 17 plane and designing it, but eh, this is probably the "biggest" one. Oh and also, it is based on balanced ternary voltage (-1 volt is 2 0 = 0 1 volt is 1).
Proof that it works better:
My multiplier (3x2)'s maximum output is 21201 (208) With ~110 MOSFET-s. A 3x2 Binary multiplier takes 10-20 MOSFETs less, i think, but its maximum output is only a weak 21. And if we make a bigger multiplier, the bigger will be the difference. My design is more data-MOSFET compact than a binary one, which could make phones and servers more efficient (the two things that need to be.) And we could use the minus part of the Wi-Fi signal wave too! The possibilities are endless!






8
u/RobotJonesDad Feb 23 '25
Can you explain a little more about how you use the transistors to get 3 states?
8
u/Xulum12 Feb 23 '25
Transistors are just switches. The voltage they switch on/off is the "data". 0v = 0 1v = 1 -1v = 2
6
u/RobotJonesDad Feb 23 '25
Why can't you make some of these circuits yourself? You may not have money to make a whole computer, but the individual circuits should be easy to put together.
10
u/Xulum12 Feb 23 '25
I did that; that's how I know that they work. I used cheap relays to do it and diodes. But if I want to actually make something, I have to use lithography, which is impossible for me, not even in the far future. Well of course i couldn't make the multiplier since it would be gigantic, but the basic logic gates are tested.
8
u/RobotJonesDad Feb 23 '25
I'd be more interested in seeing your efforts using transistors instead of relays. There are lots of discrete transistor CPU and computer projects out there. 12-bit single board discrete transistor computer
109
u/could_be_mistaken Feb 23 '25 edited Feb 23 '25
Don't stop, build a ternary CPU (or whatever you like) in a circuit simulator, there are many free options for circuit simulation software.
6
u/mycall Feb 24 '25
Do the circuit simulators support uniary computers too?
4
1
u/RelativeFisherman257 Apr 24 '26
A circuit simulator should be able to simulate any circuit, regardless of its purpose. Remember, every digital computer is literally composed of analog components. Analog circuit simulators can't tell the difference between a "digital" circuit and an analog circuit.
3
12
u/dnabre Feb 23 '25
Circuit Simulators, as many mention, should let you put together and demonstrate your designs. Look into FPGAs, using Verilog and the like, practical (binary) processors can be designed and run. Especially older/used ones, can be had for very little money (relatively speaking).
Forgive my limited (and rusty) electronics knowledge, but do you have a design for whatever the ternary equivalent of a flip-flip is -- a circuit to store and retrieve a trit? Also, I'd be curious what sort of logic falls out of being in ternary, that is beyond generalizing binary logic operators. Elegant circuits using ternary-specific operators, particularly, if they out shine binary equivalents, would be pretty interesting.
5
u/TheBlasterMaster Feb 23 '25 edited Mar 09 '25
Why a ternary, just for the fun of it? Im not an ECE guy, but i've heard that its just way more expensive for minimal benefit.
I think I only know about flash memory using more than 2 states as a practical application.
2
u/Rude-Pangolin8823 High School Student Feb 24 '25
Couldn't you design a simple breadboard computer?
1
u/Ronin-s_Spirit Feb 24 '25
Or play Scrap Mechanic.
0
u/Rude-Pangolin8823 High School Student Feb 24 '25
Cringe, do it in Minecraft.
0
u/Ronin-s_Spirit Feb 24 '25
Ah yes, that game where a single logic gate will be made of several 1 cubic meter blocks. And where the logic has limited speed and range and uncomfortable connectivity because it's connected by dust.
You don't know what you're talking about.1
u/Rude-Pangolin8823 High School Student Feb 24 '25
It was mostly a joke, tho yes I absolutely do know what I'm talking about, I'm a leading expert in the computational redstone community and have spent thousands of hours working on these silly circuits. Scrap logic has limited speed and range as well, but alongside all of that it doesn't really look like anything- its very hard to visually see what logic is supposed to be. At least to me, I didn't do all too much in scrap tbh. Funnily enough, the fastest Minecraft logic outpaces the fastest scrap logic, since there are many exploits through which you can break the tick barrier and do multiple operations per tick. (With vanilla redstone.)
If you want to be serious about it, don't do it in a game.
1
u/whatever73538 Feb 24 '25
This is amazing. Great work.
I am not convinced that this is actually more efficient, but I am very much in awe.
1
1
u/dinominant Feb 24 '25
Even if you don't find it formally accepted by an industry, the work you are doing to research, prove and implement the system is an accomplishment.
You are solving logical problems that you will encounter in other places later in life. You will have the experience and confidence to implement solutions that others avoid, simply because you've done it once before.
1
u/Kuro222 Feb 25 '25
Ternary computers are cool and are technically faster than standard binary, but at the cost of being significantly harder to manufacture. That's why you won't find anyone to actually manufacture one. Still a cool project.
1
u/Equivalent-Can869 Mar 16 '25
Why faster?
their importance is not so much in their speed, but in being able to process much more information than rails, despite being simpler
5500FP Ternary CPU1
u/Kuro222 Mar 18 '25
Why Faster?
Well, first, you need to understand how we normally measure processors, both CPUs and GPUs. We use Hertz and FLOPS. Hertz represents cycles per second, and flops are floating point operations per second. So, a higher hertz processor can do more operations in a second. More operations means more data. FLOPs, on the other hand, can be thought of as actual work done per second. If you can process more data in a single operation you'll, you have to do fewer operations. So when I said faster, I meant it could process data in fewer steps, meaning it requires fewer cycles to do the same operation.
But if you meant why is a ternary system faster, for that answer, we would have to do a deep dive into information theory and Shannon entropy specifically. But the short answer is because of some math, the best base for encoding and processing information is Eulars Number (2.718...) and since a base of 3 is closer to that than a base of 2, a trinary system would be better.
There are also theoretical gains to be had with the information density being higher in a ternary system, but this comment is already oversimplifying a complex topic, and I am not the best at explaining low-level topics like this.
1
u/clros Mar 18 '25
Yes, I know your arguments, I've created a ternary architecture myself. (5500FP Ternary CPU)
My concern was about the speed of processing information in a ternary system.
I don't fully agree that the ternary processes more data, but it is certainly true that it processes "larger" data; in our architecture, with just 24 trits it manages to represent a value 270 billion times larger than a 32-bit processor (so with more complexity). But the time it takes to do an operation (for example an addition) depends a lot on the underlying hardware architecture.If we face the exact same architecture between a binary system and a ternary one, with the same clock frequency, we will probably have the exact same speed.
It is true that to add 24 trits you do not have to wait for the carry for 8 adders and this will probably finish your addition a little earlier, but I do not think it makes much difference.
Where the ternary shines is certainly the density of information and the simplification of some operations (with only two mosfets I can get three ternary functions, in some cases, while with the binary I only have one!), but also complexity in other functions.
And then the simplification of the transmission lines, 24 trits means 8 less wires that you have to carry around on the silicon - with 48 trits you would have 16 less wires and a FRIGHTENING capacity of representation of information!)Ultimately ternary devices are great for large computers (supercomputers) and emerging applications such as AI and telecommunications.
1
u/Mysterious-Student95 Feb 25 '25
Hey buddy don’t give your stuff out for free but good luck
2
u/Sdrawkcabssa Feb 26 '25
It's not a new concept. Russia made one in the 50s. It's a fun project though.
1
u/ScienceByte Feb 26 '25
Try it out with Verilog on some sort of circuit simulating program like Questa/Quartus (although those cost money I believe)
1
u/Headz0r Feb 27 '25
There is a guy called breakingtaps that does some DiY litography. Maybe you could hit him up if he is interested in such a project.
1
u/RelativeFisherman257 Apr 24 '26
Here's the problem. Ternary doesn't work well for mass magnetic storage. It's even worse for mass flash storage. There's going to be an inefficiency in the conversion.
There is absolutely no values for 2 integers, X and Y, where 3^x = 2^y, so either the storage isn't being used to maximum capability, or the mass storage device can't store values to the extreme limits of your ternary CPU's capabilities.
Also, the transistor counts for single gates isn't the only important thing in computer design.
POWER. Now you need either GROUND, x V, and 2x V power rails. Guess what ... every gate is now using 4x as much power as before. 4x the power for 1.5 improvement in data density.
Alternatively, you could use balanced ternary (-1, 0, +1), and use Ground, -x V and +x V. Now you're looking at something like ECL (Emitter Coupled Logic). what we found with ECL, which also uses +Vpp and -Vpp, is that although it's significantly faster than any variety of TTL, CMOS, or even MOS-TTL, it's also extremely power-hungry.
ECL is used ONLY in design scenarios where speed is the utmost highest requirement(not even fighter jet computers require ECL, not even for extremely unstable air-frames such as the F-22 and F-23)
49
u/Mcby Feb 23 '25
This is a really cool achievement, hopefully you manage to build or emulate it someday if you're interested in this! However, I'd like to just comment on the idea that this approach would make phones, servers etc. more efficient, because I'm not sure it would—there's very good reason computers have taken the path they have. One of the biggest is the fact that the more voltage states you need, the more difficult it is to practically build the number of gates you'd need (you need greatly improved precision to tell the difference between multiple voltage levels as compared to simply "some" and "none") as well as the more power you need to draw. Additionally, we have an entire world economy build around the efficient, streamlined production of transistors at immense scales—the benefits of any alternative would need to be off-the-scale immense (think quantum computing) to result in a practical performance improvement: sure I could buy a ternary processor, or I could buy orders of magnitude more processing power in the form the amount of binary ones. I don't mention this to dissuade you in any way, but just to give some reason as to why it might be difficult to encourage others to help you build this—simulation or emulation would probably be the best place to start, and could help in pitching further work if you're still interested 🙂