Close

Thoughts On Premature Optimization

A project log for Tern - Ternary Logic Circuits

A series of ternary logic gates and higher level components implemented in the real world.

mechanical-advantageMechanical Advantage 06/10/2016 at 01:300 Comments

An XKCD comic got me thinking recently... that may be the nerdiest thing I've ever written.

My general plan has been to create working versions of the ternary gates necessary to eventually build something that actually performs a real function. Specifically, I wanted to build a device that would compute the Fibonacci sequence to three trits. I have now proved the functionality of every component that would be needed to do exactly that.

At the same time, I have been testing various types of transistors as replacements for the simplest of the ternary monadic gates; those ones which have only two possible outputs. I already posted one schematic that simplifies some of the monadic gates, but have realized that there are more possible simplifications to be made in that area. I've just received a delivery of more depletion mode transistors to test.

Finally, I've also been checking out current draw in these circuits and was surprised to see over 200mA being used by the Sum gate. I need to go through the different circuits I've already built and tweak the resistor values to bring that down to something more reasonable and while I'm at it, I might as well add bypass caps to all the schematics in the appropriate locations.

So basically I'm looking at a considerable amount of testing, iterating existing circuits and verifying the improvements, and documenting the improved circuits. All this before I've actually built anything beyond solderless breadboard prototypes. In other words, premature optimization.

Instead, I think I'll finish testing the transistors, use that data to improve the Sum gate if possible, document it, and then build a three-trit adder with three position switch inputs and LED outputs. This is a much more modest first-build than the Fibonacci idea, and as such, is a lot more likely to get done. And I hope to do it on a real board through Oshpark. If it all works out it will be my first PCB design.

Discussions