Finite State Machine

After playing around with several ways to construct LEGO logic gates I thought the next step would be to create a more complex logic system: a finite state machine (FSM). My first attempt was using rod-logic, and it failed because of several problems, as you can read here. This time, using a new version of logic gates based on Konrad Zuse's ideas I finally succeeded.

I implemented a very simple 2 state FSM. Here you can see the simple FSM I implemented, and how does it look in LEGO:

In order to implement such a FSM, I used 5 logic gates, organized in 4 layers or phases. The picture below shows how did I link them, and their correspondence with the LEGO construction:

Notice that there is two redundant logic gates (the two NOTs in a row) but they were added due to mechanical constraints. It's much easier to have 4 layers of logic gates than 2 or 3. This is because, each layer turns 90 degrees with respect to the previous one. Therefore, with 4, I can complete a full square.

Each Zuse's logic gate has at least 3 moving "sheets": the input, the output, and the clock. I marked the clock sheets of each of the 4 layers with a 2x2 red lego flat tile, so they can be distinguished from the rest. The one marked in blue is the input of the FSM, and the one marked in white is the sheet that stores the state of the FSM. When the white tile is "up", the state is 1, when the white tile is "down", the state is 0. In the picture above, both the input and the state are set to 0.

I think the best explanation of how it works is just a small demonstration. The animation below shows the FSM starting from state 0, with the input set to 1, and moving to state 1.

As you can see, one cycle of the FSM requires 4 phases, each of which with 2 steps:

    • Phase 1:

      • CLOCK1 = 1, reset PHASE 3: Here, we push the clock signal of PHASE 1 to the right, and also reset the output sheet of PHASE 3 to it's right-most position (0).

      • CLOCK1 = 0, we reset the clock of PHASE 1, bu pulling it left.

    • Phase 2:

      • CLOCK2 = 1, reset PHASE 4: Here, we push the clock signal of PHASE 1 down, and also reset the output sheet of PHASE 4 to it's down-most position (0).

      • CLOCK2 = 0, we reset the clock of PHASE 2, bu pulling it up.

    • Phase 3:

      • CLOCK3 = 1, reset PHASE 1: Here, we push the clock signal of PHASE 1 to the left, and also reset the output sheet of PHASE 1 to it's left-most position (0).

      • CLOCK3 = 0, we reset the clock of PHASE 3, bu pulling it right.

    • Phase 4:

      • CLOCK4 = 1, reset PHASE 1: Here, we push the clock signal of PHASE 1 down, and also reset the output sheet of PHASE 2 to it's up-most position (0).

      • CLOCK4 = 0, we reset the clock of PHASE 4, bu pulling it down.

For a bit more detail on the design, you can see this diagram, that I drew before starting to construct the FSM, in which I detail the shape of each of the 11 sheets required to build the FSM, and how do they fit together.

The current version is ugly, and the sheets are somehow hard to move. But I plan to simplify the machine a bit, and make the sheets slide better through the machine. In that way, I can connect the machine to a motorized system that can make it operate automatically. I would like to emphasize that, while other projects have created complex computing machines, such as turing machines, using LEGO, they use LEGO mindstorms, which is a computer in itself. This project aims at creating purely mechanical computing machines. Much like Charles Babbage or Konrad Zuse's early machines.