Photo: James Newman
In James Newman’s living room is a monument to our kind of crazy. Seven 2-meter-tall panels are covered with circuit boards festooned with blinking lights. It is a complete working CPU, plus 256 bytes of RAM and an input/output interface, all built out of 42,300 hand-soldered discrete transistors.
It took Newman some four years and roughly £40,000 sterling (about US $52,500) to build and design the so-called Megaprocessor in his home in Cambridge, England. In some absinthe-tinged sense, the project is the logical end point of his software writing career. Newman explains that, over the years, he found himself doing increasingly low-level programming, and so became more and more interested in the underlying hardware. He says he began working on the Megaprocessor because he “wanted to build a processor to see how a real one worked.”
The end result is a surprisingly full-featured machine. It’s 16-bit, with 8-bit opcodes, and basic pipelining, where the next instruction is fetched as the first is executed. All 256 possible instructions are implemented, including ones for relatively advanced math functions. There are four general-purpose registers in addition to a program counter, stack pointer, and status register. “I could have built a minimal processor, but I don’t know what that would have showed,” says Newman. He admits though that he did “get carried away a little bit. I quite liked investigating how to do multiply, divide, and square root.”
Subsections of the processor—such as binary adders—are built from custom-made printed circuit boards. Each logic gate indicates the state of its inputs and outputs with red LEDs, and every memory cell similarly uses an LED to indicate its contents (driving the LEDs is actually responsible for most of the approximately 500 watts the Megaprocessor consumes). The boards are wired together on frames, with each frame making up a major system, such as the arithmetic logic unit or the instruction decoder. The CPU clock can be halted at any point or varied between about 1 hertz and 8 kilohertz (fast enough to play Tetris), and an optional 32 kilobytes of external memory (implemented using boring old integrated circuits) is accessible via the input/output interface.
Each frame holds a major subsystem (top) such as the arithmetic logic unit or the instruction decoder. Subsystems are built from custom-printed circuit boards wired together. Transistors and LEDs are soldered into each board so that the inputs and outputs of each logic gate are indicated (bottom).Photos: James Newman
In part, the relative complexity of the processor was a trade-off intended to reduce the amount of effort required for the construction of the internal memory. You “don’t have the whole picture unless you show what is going on in the memory,” says Newman, “but I quickly realized that building the memory was going to be as painful as building the processor. That kind of pushed toward increasing the capability of the processor, so I didn’t need as much program data.” (The memory accounts for 64 percent of the Megaprocessor’s transistor count.)
The biggest setback in building the Megaprocessor came right at the end of the assembly. Newman ordered a last batch of about 4,000 transistors. “I ordered the right ones, and the packing list said they were the ones I wanted, and they looked like the ones I wanted. So I used them all.” But when Newman began testing the completed boards, nothing worked. “It took a while before I realized the full horror of what had happened,” he says: The final batch had been the wrong kind of transistor. “I wasted about a month of tedious soldering. It was bad enough having to do that again, but it was worse because I felt I’d finished the soldering,” says Newman. “Yes, we can laugh now, but it was a bad day.”
Newman is currently in discussions about finding a permanent home for the Megaprocessor, where the general public will be able to view it without requiring an invitation to his house. In the meantime, if you want to try your hand at programming this masterpiece of transistorized glory, you can download a simulator for the Windows operating system from https://www.megaprocessor.com.
This article appears in the October 2016 print issue as “The Megaprocessor.”