Fishbreath Plays: MHRD Review

If you like puzzle games, it’s a good time to be alive. You’ve got your programming puzzle games, like Shenzhen I/O, SpaceChem, and really, the entire Zachtronics catalog; you’ve got your process optimization puzzle games, like Big Pharma and Production Line; you’ve got puzzle games of every shape, size, color, and description.

You even have, it turns out, logic puzzlers. That’s where MHRD comes in. You’re a hardware engineer for the waggishly-named Microhard, a company building the Next Big Thing in CPU design in the 1980s. You start with a single logic element: a NAND gate (for the uninitiated, that means not-and). You end up with a simple but entirely functional 16-bit CPU1, designing all the logic circuits you need along the way. Start with NAND, build the rest of the logic gates, figure out your multiplexers, demultiplexers, adders, and memory elements, put it all together into your higher-level CPU components.

It’s packaged in a fun, oldtimey DOS-style terminal editor, and unlike a lot of retro UIs, it doesn’t wear out its welcome. All your circuit design happens in a hardware description language, in an in-game editor. The editor has some foibles: it doesn’t scroll, and it only does line wrapping when adding text. On the other hand, it has a decent auto-completion engine. The hardware description language makes sense: you refer to pins and buses by name, connecting them to other pins and buses with an arrow operator. For instance, opCode->alu.opCode would connect the circuit’s opCode input to the ALU’s opCode input. Generally, the syntax is straightforward and easy to remember. Sound effects are basic; you get a background fan whir befitting an old PC, and an IBM keyboard sound effect which wears out its welcome after a while.

That’s all there is to it, which brings me to my next point. Is it good as a game? That’s a harder question to answer. It is sited in a difficult middle ground. It can’t be too freeform—given an instruction set and a CPU specification, very few people who don’t already know how could build all the necessary subcomponents. At the same time, it shouldn’t be too static, or else it feels a little too much like rote construction to the truth table for the component at issue. MHRD errs a bit too far in the latter direction. There is no real sandbox. All you’re doing is building the gates and circuits the game tells you to, in exactly that order. There’s no discovery to be had, and not a lot of freedom to design solutions in different ways. Unlike, say, Shenzhen I/O, the problems are small enough that it’s never all that unclear how to solve them.

That isn’t to say that there’s no fun to be had. If you aren’t a hardware engineer, or a software engineer with a deep interest in hardware2, you will find it fascinating how few steps it takes to get from a NAND gate to a functioning processor3. There are leaderboards, too, based on NAND counts for each element. Given that logic design is a fairly well-understood field, the NAND counts are uniformly the smallest possible number of gates required for each task, which gives you a nice target to aim for. The developer is active on his Steam forum, and seems to have more planned for the game. Given that it’s an atmospheric logic puzzle that I, an experienced software engineer, found enjoyable and educational, I think it’s worth a buy. (You may want to wait for a a sale.)

At the same time, there’s a better way. (If you’ve been reading the footnotes, you should have seen this coming.) There’s a free course out there, a Computer Science 101 sort of thing, called Nand2Tetris. As the name suggests, it’s similar to MHRD in that you’re building a CPU from a NAND gate alone. Nand2Tetris differs in two ways. First, it isn’t a game. As such, there isn’t a plot (MHRD’s is skeletal, but present), or any pretension that it’s about anything besides learning. Second, it goes a lot further. MHRD stops at the aforementioned functional CPU. The last puzzle combines the instruction decoder, the ALU, and some registers, and that’s it. It verifies your solution by running a few instructions through the CPU, and you’re done.

Nand2Tetris, as the name suggests, keeps going. After you finish the CPU, you write a compiler to generate your microcode. After you write your compiler, you write an operating system. After that, you can run Tetris. Furthermore, although you have assignments, you also have a proper sandbox. You get a hardware design language and a hardware simulator, and you can build anything you like. That, I feel, is the promise of a logic design puzzle game, and MHRD doesn’t quite deliver.

In the final reckoning, though, I say MHRD is worth the price of entry. I don’t really have the inclination to write my own compiler, and I have plenty of other software projects besides. If you’re only interested in the logic design portion, you ought to get MHRD too. If, on the other hand, you want to really understand how computers work—how the processor you built becomes the computer you use every day—try Nand2Tetris instead.

  1. It’s very similar in architecture, I understand, to the CPU designed in the Nand2Tetris course. We’ll come back to that. 
  2. Or a very good memory for that hardware class you took back in college. 
  3. Not counting the memory elements, the CPU task takes fewer than 800 NAND gates in the minimal solution. My current best is 3500. 

Leave a Reply