Computer Science Essentials, Unit 10, Lesson 3 of 3

Logic for real systems

GCSE Computer Science, Boolean logic, 25 minutes

Sign in

Turn descriptions of alarms, lights and machines into expressions, truth tables and circuits, and use logic in program conditions.

What you will learn

  • Write an expression from a description
  • Complete its truth table
  • Choose the right circuit for a system
  • Use AND, OR and NOT in program conditions

From words to logic

A logic problem describes a system.

Pick out each input (given a letter), then the words that join them.

  • "and", "both" → AND
  • "or", "either" → OR
  • "not", "unless", "except when" → NOT (with AND)
  • "but not while" → AND NOT

A fan (Q) turns on when the room is hot (A) and the window is not open (B): Q = A AND NOT B.

Check by testing a row or two against the description: hot and window shut gives A = 1, B = 0, so Q = 1. Good.

The rest of this lesson and its 7 practice questions are locked.

In this lesson

  1. From words to logic
  2. Design and test
  3. Try it: Describe a system

7 practice questions, marked as you go; about 25 minutes in all.

Key terms

And, Either, Unless, Except when, But not while

In this unit: Boolean logic

AND, OR, NOT and XOR gates, truth tables, expressions and circuits, built by hand in an interactive gate builder and used to describe real systems.

All of Boolean logic