Logic Gates

Category: Logic and Proof   Level: 201

Y = (A ∧ B) ∨ ¬ C

A logic circuit computes a truth value from its inputs. Signals flow left to right, and each gate applies AND, OR, or NOT to the values that reach it.

Step through it

Watch it

Animated walkthrough

Step by step

Step 1: Read the circuit

Signals enter on the left and flow right. A and B feed an AND gate, C feeds a NOT gate, and both results feed an OR gate that produces Y.

Y = (A ∧ B) ∨ ¬ C

Step 1: Read the circuit

Step 2: Set the inputs

Pick one input row: A = 1, B = 0, C = 0. Green wires carry 1 (true) and red wires carry 0 (false).

A = 1, B = 0, C = 0

Step 2: Set the inputs

Step 3: Evaluate the AND gate

AND outputs 1 only when both inputs are 1. Here B is 0, so the AND output is 0.

A ∧ B = 1 ∧ 0 = 0

Step 3: Evaluate the AND gate

Step 4: Evaluate the NOT gate

NOT flips its input. C is 0, so the NOT output is 1.

¬ C = ¬ 0 = 1

Step 4: Evaluate the NOT gate

Step 5: Evaluate the OR gate

OR outputs 1 when at least one input is 1. The NOT branch carries a 1, so Y is 1 even though the AND branch is 0.

Y = 0 ∨ 1 = 1

Step 5: Evaluate the OR gate

Step 6: See every input row

Repeat the same flow for all eight input rows to get the truth table of the circuit. The row traced above is outlined.

23 = 8 rows

Step 6: See every input row

All steps at once

Storyboard

Generate it yourself

cd svg-generator
python3 -m svgmath render logic-gates --out /tmp/logic-gates

Source: svgmath/diagrams/logic.py