ExamYard Lectures

Logic gates and truth tables

IGCSE Computer Science 0478 · Chapter 10, Boolean logic · 6-minute lecture

The teaching part (2 min) is free to watch. A free account opens the whole lecture: 7 practice questions, 2 real past-paper questions with the answers explained, the mistakes that lose marks, the full-marks tip, a one-card summary and a quick quiz.

What this lecture covers

  1. Computers are made of switches
  2. Gates and truth tables
  3. The NOT gate
  4. AND and OR
  5. NAND, NOR and XOR
  6. Remember them
Read the transcript of the teaching part

Last time

Before we start: last time, in Circuits and truth tables from a logic statement, you learned these points. Here they are again on one card. Keep them in mind, because today builds on them.

Computers are made of switches

Inside every processor, millions of tiny switches decide yes or no. Each decision is made by a logic gate. A gate takes one or two inputs, each a one or a zero, and produces one output. In this lesson we learn six gates, and how to read them in a circuit.

Gates and truth tables

A logic gate is an electronic component that performs a logical operation on binary inputs. One means true, on or high. Zero means false, off or low. A truth table shows the output for every possible combination of inputs. A logic circuit joins gates together: the output of one becomes the input of the next.

The NOT gate

The NOT gate has one input, and it reverses it. If A is zero, the output is one. If A is one, the output is zero. The expression is X equals NOT A.

AND and OR

AND outputs one only when both inputs are one. OR outputs one when either input is one, or both. Look down the AND column: three zeros, then one. Look down the OR column: a zero, then three ones.

NAND, NOR and XOR

NAND is NOT AND: it outputs zero only when both inputs are one. NOR is NOT OR: it outputs one only when both inputs are zero. XOR, exclusive OR, outputs one when the inputs are different.

Remember them

AND means all ones. OR means any one. XOR means different. NAND and NOR are simply the opposite of AND and OR. The small circle on NOT, NAND and NOR means invert the output. In the exam, every gate except NOT has exactly two inputs.

How often it comes up

The whole chapter: Boolean Logic.

Chapter 10: Boolean logic

Also for IGCSE Computer Science 0478

Which topics come up most in IGCSE Computer Science 0478 past papers, counted from every paper since 2004: Paper 1 topic frequency, Paper 2 topic frequency.

The topical past-paper books: Paper 1, Paper 2.