How To Build Your Own LEGO Turing Machine

Share

How To Build Your Own LEGO Turing Machine

In honor of Alan Turing's hundredth birthday, Davy Landman, Jereon van den Bos, and Paul Klint built a Turing Machine out of LEGOs. And if you like, you can build one too.

You can buy the LEGOS on the web, and the three Dutch researchers have posted the machine's software to GitHub, the popular code repository and software version control service.

"The beauty of the Turing Machine is that it is conceptually a very simple device," Landman tells Wired.

Turing would have turned 100 on Saturday. He was 24 when he described his Turing machine – originally known as the "a(utomatic)-machine" – a device that reads and writes symbols on a strip of tape according to a particular set of rules. In short, it's a computer. The same basic concepts underpin every computer we use today.

To build one, you need a tape, something to move it backwards and forward, and a head that reads and writes the symbols. Landman, van den Bos, and Klint built theirs using a single box of LEGO Mindstorms NXT, a set of LEGOs that includes various motorized parts and a mini-computer. In this case, the tape isn't really a tape. It's a set of LEGO "angle connectors" that act as switches.

Each connector can move back and forth between two positions, and these positions represent 1s and 0s. A rotating LEGO beam can move the connectors from position to position, and a light sensor reads the positions. Turing described a machine with an infinite tape, but the Dutch team didn't have infinite LEGOS. They settled on a tape with 32 positions.

The team then used LEGO's simple computer – known as the NXT Brick – to execute instructions on their tape. They wrote these instructions using NXC, a simple language developed by the MINDSTROMS community, and they built an interface for the machine using the Rascal meta-programming language. (see image).

In addition to open sourcing the code on GitHub, the team would have liked to include instructions for building the machine itself, but Landman says this hasn't quite happened yet. "We fear that may turn out to be a larger project than the machine itself."

He admits that the machine hasn't quite been perfected yet. But that shouldn't stop you. After all, this is Alan Turing's birthday we're celebrating. It's an occasion to give your brain a bit of a stretch.