Level 4: At least one

Open the level →

Task

Build a logical OR gate.

OR outputs 1 if at least ONE input is 1.

Related Materials

  • OR — logical addition

Solution

Use De Morgan's law: A OR B = NOT(NOT A AND NOT B). Translated to circuit:

Keep this intuition in mind: saying "A OR B fires" is the same as saying "it is not true that both are off". As long as at least one input is active, the circuit fires. That is why De Morgan makes NOT+NAND universal: any gate can be built from them.

1. Invert both inputs A and B — place two NOT gates, feed each input to its own NOT. 2. Feed the outputs of both NOTs to AND inputs — AND outputs 1 only when BOTH inverted inputs are 1, which happens when original A and B are BOTH 0. 3. Invert the AND output with a third NOT — now output is 1 when original A and B are NOT both 0, i.e. when at least one is 1. That is OR.

Connect the last NOT output to Output.

Solution circuit for level 4 — At least one
The authored solution for level 4 in the simulator (dark theme)