ExamYard Lectures

Circuits and truth tables from a logic statement

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: 5 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. From words to wires
  2. The method
  3. A greenhouse alarm
  4. Translating the phrases
  5. The greenhouse circuit
  6. The truth table
Read the transcript of the teaching part

Last time

Before we start: last time, in File handling and writing a complete program, you learned these points. Here they are again on one card. Keep them in mind, because today builds on them.

From words to wires

An engineer is told: the alarm should sound if the temperature is high and the window is closed. That sentence has to become a circuit. First an expression. Then a drawing. Then a truth table to check it. This is the last skill in the course, and the one that earns the most marks in the logic question.

The method

First, give each input a letter, and decide what one and zero mean. Second, turn each phrase into a small expression. Third, join the phrases with AND or OR, as the sentence says. Fourth, draw the circuit and fill in the truth table to check.

A greenhouse alarm

An alarm X sounds when the temperature is high and the windows are closed, or when the temperature is high and the humidity is high. T is one when the temperature is above thirty. W is one when the windows are open. H is one when the humidity is high.

Translating the phrases

The temperature is high: that is simply T. The windows are closed: closed is W equals zero, so that is NOT W. The humidity is high: that is H. Joining: T and NOT W, or T and H. So X is (T AND NOT W) OR (T AND H).

The greenhouse circuit

A NOT gate for W. An AND gate for T and NOT W, and another for T and H. An OR gate joins the two. T is a branch point: it feeds both AND gates.

The truth table

The alarm sounds in three rows. Rows five and six: T is one and W is zero: temperature high and the windows closed. Row eight: all three inputs are one, so T AND H is one. It never sounds when T is zero.

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.