Design goals

Having discovered that it looks at least plausible that I could build something, the next exercise is to decide what to build.

Prior work

Of course, it’s not exactly like I’m the first person to attempt to build a computer from scratch. Naturally, this is how the very first computers were created in the first place! But more than that, a little research reveals that there’s already a wide range of home-made computers out there, made by nerds like me who decided to make one because, why not?

However, it turns out many of these are not what they seem. For example, Wikipedia has an image of a computer built from 7400s. However, on closer inspection, this is not actually a computer built out of 7400 ICs, it’s built out of 7400 series ICs which includes adders, multiplexers, and even large static RAM blocks.

Other people have built computers out of single logic gates, or even individual transistors. But when someone says they built “a computer” out of whatever, it turns out they almost unanimously mean they built a processor out of [whatever], and then hooked it up to normal commodity RAM to hold data. Frequently, they then take their giant contraption and hook it up to a Raspbery Pi (!) as the “input/output device”.

…So, you laboriously built this custom computer, and then immediately hooked it up to another computer that’s 1,000,000,000× more powerful? At this point, you could throw your whole “computer” in the bin and just use the Pi, and it wouldn’t make any different to anything!

Even the Megaprocessor falls short here. This is a giant machine built out of DTL (diode-transistor logic), originally in some guy’s house. It currently lives at the Centre for Computer History in Cambridge, which means you can actually go and visit it if you want. This massive thing fills an entire room, consists of dozens of circuit boards hooked together with a tangle of ribbon cables, and has an LED on almost every single gate input and output.

The clock speed is adjustable, so you can slow it down to the point where you can actually watch what the LEDs are doing. (Although given the size of the machine, you’ll have to run fast to follow the signals around the thing!)

The Megaprocessor does better than most. The guy built a huge rack containing ¼ KB of static RAM in discrete transistors. Since all the cells have LEDs, it also doubles as a crude display; the museum currently has it running Tetris.

But even the Megaprocessor (which apparently cost about ~£40,000 to build!) falls short. Tucked away in a corner is a tiny little chip containing an additional 32 KB of RAM! So, you could remove the impressive RAM wall entirely and you’d only be loosing 0.78% of the RAM capacity.

Similarly, there’s a normal PC (!) hooked up to it to load and save programs. And let’s not forget, there’s a tiny chip you probably didn’t even notice… that’s actually an FPGA running a simulation of the entire machine! You could literally just run that, and it would be the same. (It’s there for debugging purposes; if the real machine diverges from the simulated one, the system automatically halts for hand debugging.)

You know what? In 1940-whatever, when the first built computers… they didn’t have field-programmable gate arrays or giant static RAM chips.

(To be clear: I still think the Megaprocessor is a very cool project, and I’m glad it’s now available to the public. It’s way cooler than anything I’m ever likely to make! All I’m saying is, everybody seems to invest all this effort building a processor, and then get bored and “cheat” on the rest of the system.)

What to make?

Well, it’s all very easy to criticise what everybody else has made, isn’t it? You know what isn’t so easy? Making something better yourself! So enough whining about everybody else; what are you going to make?

Now, there are several different possibilities here. I mean, I could try to make a non-electronic computer, for example. I’m not going to, but it’s theoretically possible.

I guess the real question is, “why am I building this?” What is my goal?

The real reason I’m building this is basically to prove to myself that I can. I mean, I keep saying I could join some logic gates together and make a computer. OK then, do it!

So my initial plan was to use pre-made logic gates to build a computer. Initially I looked at the 7400 series. I did spend some time actually looking at what it would cost to build a machine with electromechanical relays… but that’s quite a bit more complicated, would take up a lot more space, and would be much more expensive. Most especially, the relays with transparent cases seem to be particularly pricey (especially considering how many I’d need).

So it’s 7400-series chips all the way, then. Looking into this, the original 7400-series is TTL (transistor-transistor logic). There’s a newer 4000-series, which is CMOS (complementary metal oxide semiconductor). CMOS is supposedly “better” (faster, lower power), but more suseptable to electrostatic discharge damage. Also, the 4000-series has different part numbers and pinouts; they’re not drop-in replacements.

Then I discovered there’s actually several families of 7400s which are pin-compatible and have the same part numbers, but are actually CMOS. Most particularly, the 74HCxx series (“High-performance CMOS”) works from 2V to 6V and is quite fast. (I don’t know why that matters; I’m only going to run this at fractional Hertz!)

The 74HCxx series has best performance at about 5V. So it’s decided then; I’m using 74HCxx at 5V for my logic, and mechanical switches for input, and LEDs for output. In theory, I know how to do all that. In theory, theory and practise are the same. In practise…

Now, the 74xx series includes all sorts of different logic gates (and, indeed, larger logic blocks as well). I could buy a bunch of AND gates, another bunch of OR gates, and another of NOT gates, and I’d pretty much be set. That does mean, though, that I’d have to keep track of which chip is what, and I’d have to keep stock of three sets of chips, and you just know I’m going to end up with one circuit that needs one extra OR gate for some reason, forcing me to add an entire chip just to use one gate. (The chips generally come with either 4 or 6 gates per chip.)

Now 7404 contains 6 NOT gates, 7408 contains 4 AND gates, the 7402 has 4 NOR gates, but if you want OR gates you have to scroll all the way down to the 7432. (And at around 7441 or so you start getting decoders, multiplexers and so on.) However, the 7400 itself (the chip, not the family) contains 4 NAND gates.

Now a NAND is a “universal” logic gate. You can construct a normal AND gate out of a pair of NANDs. And 3 NANDs can make an OR gate. A single NAND can be configured as a NOT. So actually, if I just buy 7400s, I can make any logic gate I could possibly need. And, so long as I do everything in 4s, I should end up using a whole number of chips for each design. (So, no wasted gates.) And now I only need to buy 1 type of chip!

(In case you’re curious, the exact same statements apply to NOR gates. I could just buy a heap of 7402 chips instead of 7400, and it would be the same.)

So that was my eventual plan. 74HC00 chips, running at 5V, with switches and LEDs, and a big heap of breadboards to mount it on. In theory, I know how to turn NANDs into anything, so now I just need to do it…

(As you will later see, this plan changed a bit over time.)

I did consider going the FPGA route. But then, I mean, I could simulate a design in software even easier still. I want to see if all the lofty ideas I have in my head actually translate into real hardware, rather than building just another black box.

Leave a Reply