/building · 2011
Lego Logic Gates
not · nor · and · xor
NOT, NOR, AND, and XOR gates built from Technic axles and beams, where an axle pushed in is a one and pulled out is a zero.

The trick is to decide that an axle sliding back and forth inside a beam is a signal. Pushed in is one, pulled out is zero. Once you accept that, a logic gate is a mechanism that moves an output axle to the right position for a given pair of input axles, and you can go looking for one in a box of Technic parts.

NOT and NOR came quickly. Inversion is a lever, and NOR follows from it without much trouble.


AND and XOR took considerably longer. Both need the mechanism to tell one input being high apart from both being high, and finding a linkage that does that without binding or sticking took a lot of rebuilding. XOR ended up the widest of the four by some margin.

I posted the result as an answer to a question on the Bricks Stack Exchange about whether logic gates can be built from Lego mechanics, and that is still how most people find it. Others built better versions, and for a while in the early 2010s there was a small community around mechanical logic. It remains the thing strangers most often email me about, usually with an improvement attached.