Level 2: Negation

Open the level →Where it fits in the machine →

Task

Goal: build an inverter (NOT) from a single NAND gate.

An inverter flips 0 to 1 and 1 to 0. NAND is an AND-NOT gate: its output is 0 only when both inputs are 1.

The main idea: feed the same signal into both NAND inputs and the gate becomes a NOT. One type of gate is enough to build all the logic in this course.

Path to this level

The competencies this level develops and their formation levels.

Related Materials

Solution for self-check

Try building the circuit yourself first. The solution below is a way to check yourself if you're stuck or have already solved it.

What you should get: Input=1 gives 0 on the output, Input=0 gives 1.

NAND has two inputs (A and B) and one output (Q). It outputs 0 only when A=1 and B=1; in all other cases the output is 1.

Feed both inputs the same value:

  • Input=1 → A=1, B=1 → Q=0.
  • Input=0 → A=0, B=0 → Q=1.

The output is always the opposite of the input. This is NOT.

  1. Run a wire from Input.Q to NAND.A.
  2. Run a second wire from Input.Q to NAND.B.
  3. Connect NAND.Q to Output.D.
Solution circuit for level 2 — Negation
The authored solution for level 2 in the simulator (dark theme)

Check yourself

Why do we need two wires from one input?

NAND looks at both inputs. When both carry the same value, it behaves as NOT.