Logic gates and truth tables – AND, OR, NOT, NAND, NOR, XOR, half adder and circuit builder

Design & TechnologyElectronics & MicrocontrollersAges 17–18

Use with my class

Pick a logic gate, flip the input switches (0/1), and watch the logic level travel along the wires to the output LED; the truth table beside it highlights the current row, together with the Boolean algebra expression. Half adder mode combines an XOR and an AND gate to compute the sum S and carry C of two bits; the Auto Run button steps through every input combination in turn. The circuit builder lets students drag AND, OR, NOT, NAND, NOR and XOR gates onto a board and wire a circuit with 2–4 inputs, or type a Boolean expression; the truth table, expression and Karnaugh map are generated, with real-world problems to check against a target truth table and simplification steps using Boolean identities.

Lesson: Introduction to digital electronics: logic gates, truth tables, logic circuits, Boolean expressions and simplification

What it shows

Digital circuits represent information with two logic levels, 1 (high voltage) and 0 (low voltage). The gate view shows AND, OR, NOT, NAND, NOR and XOR as a symbol, a truth table and a Boolean expression; a truth table lists the output for all 2ⁿ input combinations. The half adder adds two bits: XOR gives the sum S and AND the carry C. In the circuit builder students wire gates into their own circuits, or type an expression, and the truth table and expression are generated. A Karnaugh map groups neighbouring 1s, using laws such as X + X̅ = 1, to reach the simplest sum of products.

How to use

Choose a gate under Gate / circuit and click the input switches, asking students to predict each output first. Set the Number of inputs to 3 or press Auto Run to step through the table. Then choose Circuit builder: drag gates from the strip, wire outputs to inputs and watch the truth table and expression appear. Pick a Builder task such as the security alarm, build it and press Check. Finally compare the circuit with the Karnaugh map and press Build the simplified circuit.

Parameters you can change

  • Gate / circuit AND, OR, NOT, NAND, NOR, XOR (exclusive OR), Half adder (XOR + AND), Circuit builder (drag gates, expression, Karnaugh map)
  • Number of inputs (AND/OR/NAND/NOR/XOR gates) 2–3
  • Show truth table
  • Automatically step through input combinations
  • Builder task Free building, Problem: security alarm, Problem: staircase light, Problem: majority vote, Problem: machine guard, Match a random truth table
  • Expression notation (builder) A·B, A + B, overbar, A ∧ B, A ∨ B, ¬A, A AND B, A OR B, NOT A

Questions to explore

  1. For which input combinations does a NAND gate output 0?
  2. How many rows does the truth table have for a gate with 3 inputs, and why?
  3. With two inputs, in which row do the outputs of OR and XOR differ?