I've been wanting to create a small "LEGO computer" for a long time. And I've been recently gathering links from related projects, from where I'm taking inspiration (like LEGO Turing machines or the impressive LEGO Difference Engine). While I'm not too impressed with the existing LEGO Turing machines, since they use a computer (the Mindstorms brick) as part of the construction, and thus, they are not purely mechanical machines. The Difference Engine is, however, by far the most impressive LEGO construction I've ever seen (although it cannot be programmed, and it always performs the same computation). I've been wondering if it's possible to create a purely mechanical LEGO Turing machine.
While thinking about how to build it, I found a couple of very interesting pages describing how to mechanically implement Boolean logic using LEGO (both using gears and rods). In particular I think rod logic is very interesting and scalable. You can see a demonstration in this youtube video. So, I decided to try and test some simple logic gates using that technique with LEGO. Here's a small example of an OR gate. But any logic operation can be modeled this way (check out this full adder).
The basic idea of rod logic, is to have a series of rods, each of them having a series of pegs in them. Depending on the way you configure the pegs in the rods, some rods might move, or get stuck (thus implementing Boolean logic operations). I'm not going to explain in detail how rod logic works, since that is explained very well in the links above. So, I'll limit myself to explain how does the LEGO rod-logic OR gate works. The gate consists of 4 rods:
Here you can see 4 sequences of 3 pictures showing the previous 3 time steps for the 4 possible input configurations of AB (00, 01, 10, and 11):
Sequence for A = 0, B = 0:
In this case, when we push T to the right, there is a peg in T that blocks the movement of C. Thus, when in step 3, we push C up, it does not move.
Sequence for A = 0, B = 1:
Sequence for A = 1, B = 0:
Sequence for A = 1, B = 1:
An OR gate is not much, but this is the basic building block for a LEGO computer. Next time, I'll attempt a more complex logical operation. Also, for this to work automatically, I need to build a "clock" mechanism that pushes and pulls the rods at the appropriate time.