How to Build OR When You Only Have AND and NOT

Before level 4 the game offers a short interactive intro: you toggle the switches on a three-gate circuit and find yourself the rule that produces OR. This page tells the same story in text.

Experiment: a double negation

Here is the circuit: two NOTs, then an AND, then one more NOT. Two switches A and B and lamp Q. Flip through all four switch combinations and notice: the lamp goes dark in exactly one case — when both switches are off. In the other three it is lit.

ABQ
000
011
101
111

The shape of this table looks familiar: the lamp is on if at least one switch is on. That is how OR behaves. Yet here it is assembled from different parts — from NOTs and an AND.

Predict: remove the last NOT

Take the last NOT off the output — what is left is two NOTs and an AND. What does the lamp show now with A=0, B=0? A one: each NOT gives 1, and the AND lets it through. In the original circuit it was the last NOT that darkened the lamp — it flipped that one into a zero. Without it the one comes out, and the lamp lights only when both switches are off: that is a NOR.

The rule: De Morgan's law

What you saw is De Morgan's law. In words: "OR = invert both inputs, take AND, invert the output". The two NOTs on the inputs are the inverted inputs, the AND joins them, and the last NOT inverts the output: NOT(NOT A AND NOT B). Swap AND and OR in the rule and you get the second form: "AND = invert both inputs, take OR, invert the output".

An example from life

The condition "not (both checks failed)" means the same as "at least one check passed". The structure is the same: "failed" is an inverted "passed", the AND joins the two failures, and the outer "not" flips the result. In circuits the same move builds a missing gate from the ones you have: on level 4 your parts bin holds NOT and AND, and OR is built exactly this way.

Take the intro in the game · Level 4 guide · All intros