TechTayari

S15 · Computer Studies II · Grade 11 · ages 16–17

Logic Gates

Gates, truth tables and Boolean expressions

Grade 11 · 1.3 Logic GatesCBE strandFree · works offline

▶ Start the interactive lesson

The full lesson adds narration, an interactive mission and a 10-question bank, and the quiz explains any mistakes.

What a logic gate is

A logic gate is a tiny electronic circuit that takes one or more inputs, each 0 (off) or 1 (on), and gives one output. Gates are built from transistors, and billions of them inside a CPU make every decision a computer takes.

AND, OR, NOT

AND gives 1 only when all inputs are 1, like a lift that moves only when the door is closed AND a button is pressed. OR gives 1 when at least one input is 1. NOT has one input and flips it: 1 becomes 0 and 0 becomes 1.

NAND, NOR, XOR, XNOR

NAND is NOT AND: it gives 0 only when all inputs are 1. NOR is NOT OR: it gives 1 only when all inputs are 0. XOR (exclusive OR) gives 1 when the inputs are different. XNOR gives 1 when they are the same. NAND and NOR are called universal gates, because any other gate can be built from them alone.

Truth tables

A truth table lists every possible input combination and the output for each. Two inputs give 4 rows (00, 01, 10, 11); three inputs give 8 rows. It is the clearest way to describe exactly what a gate or circuit does.

Boolean expressions

Gates can be written as Boolean algebra: A · B (or AB) for A AND B, A + B for A OR B, Ā (A with a bar, also written A′) for NOT A, and A ⊕ B for XOR. So Q = Ā · B means "output Q is 1 when A is 0 AND B is 1".

Key points

  • A logic gate takes inputs of zero or one and gives a single output.
  • AND needs all inputs on; OR needs at least one.
  • NOT flips its input.
  • NAND and NOR are the opposites of AND and OR, and they can build any other gate.
  • XOR is on when the inputs differ; XNOR when they match.
  • A truth table lists every input combination and its output.
  • In Boolean algebra, a dot means AND, a plus means OR, and a bar means NOT.

Try it for real: Gates in real life

  • Use the explainer above: test each gate with all four input combinations and write its truth table.
  • Find one real-life example of an AND decision and one of an OR decision at home or school.
▶ Start the interactive lesson