A-Level Computer Science / Unit 3: Hardware, Memory and Control

3.2.2 From Problem Statements to Logic Circuits

🔒 Lesson slides are available to signed-in users. Sign in

AS Computer Science

From Problem Statements to Logic Circuits

A rule can be written in ordinary English. We can change the rule into Boolean logic and then build a logic circuit that follows it.

By the end, I can…

  • find the input conditions in a short problem;
  • translate the conditions into a logic expression;
  • plan a circuit using gates with one or two inputs;
  • write an expression from the rows of a truth table where X = 1.
Language supportcondition = a requirement that may be true or falsederive = work out from informationequivalent = gives the same output for every input combination

1. Read a problem carefully

A community art centre has an interactive sound station. It plays a short sound when a visitor presses START and headphones are connected. A staff member can also play the sound using a test button.

First, give one letter to each condition:

LetterWhen it is 1When it is 0
AVisitor presses STARTSTART is not pressed
BHeadphones are connectedHeadphones are not connected
CStaff test button is pressedStaff test button is not pressed
XSound playsSound does not play

A common exam problem

Always check what 1 means. If a question says “B = 1 when the case is locked”, then “case not locked” must be written NOT B.

2. Change words into an expression

Part 1: normal use

Visitor presses START AND headphones are connected.

A AND B

Part 2: staff test

The staff test button is another way to play a sound.

C

Normal use OR staff test gives the full expression:

X = (A AND B) OR C

  1. Use AND when both conditions are needed.
  2. Use OR when either route can make the output 1.
  3. Use NOT when the rule means the opposite of a variable.
  4. Use brackets to keep connected conditions together.
Word cluesboth → ANDeither → often ORnot → NOTexactly one → XOR

Important: Do not choose operators from keywords alone. Read the whole rule. In normal English, “or” sometimes means exactly one; in Boolean logic, OR includes both. XOR means exactly one of two inputs is 1.

3. Plan and build the circuit

For X = (A AND B) OR C, make the first part and then join it to C.

Gate 1 · ANDA and B enter. Output = P.
Gate 2 · ORP and C enter. Output = X.

A gate takes its inputs from the left and gives an output on the right. P is an intermediate output.

Exam check: NOT has one input. AND, OR, NAND, NOR and XOR each have two inputs. If you need to join three conditions with AND, connect two AND gates, rather than drawing one three-input gate.

What about a negative condition?

Imagine a remote reading device. It saves a value when (A OR NOT B) AND C is true. Here, B = 1 means “a warning is active”. The device first makes NOT B, then ORs this with A, then ANDs the result with C.

Draw the gates in this order: NOT B → OR with A → AND with C.

4. Make an expression from a truth table

Sometimes the exam gives you the output values but not the expression. One reliable method is to use every row where X = 1.

Consider this original two-input table:

ABXWhat to write
001NOT A AND NOT B
010Not used
101A AND NOT B
110Not used

Join the two selected rows with OR:

X = (NOT A AND NOT B) OR (A AND NOT B)

This expression is correct even though it can be simplified to NOT B. You do not need to simplify unless the question asks for it.

Inside one selected row

Use AND to combine all inputs. A 0 becomes NOT A, NOT B, etc.

Between selected rows

Use OR. Each selected row gives another way for X to be 1.

Common mistake: Do not take rows where X = 0 when you are using the output-1 method. For a three-input expression, a selected row like 101 means A AND NOT B AND C.

5. Interactive: Logic Translation Studio

Use the first activity to interpret a rule. Use the second to create an expression from truth-table rows. You will get feedback at each step.

Logic Translation Studio

Read → Translate → Test

2 activities

Sound station

Complete the expression:

X = (A)C
Completed: 0 / 3 situations

Test the rule — change A, B, or C after checking the expression.

For learning, the studio checks expressions in a fixed structured form. Other equivalent expressions may also be correct in an exam.

6. Original exam-style practice

Question A · Translate [3]

A parcel-sorting indicator turns on when a parcel is scanned and the lane is ready, or when a supervisor presses the test switch. Define A, B and C, and write an expression for X.

Show suggested answer

A = parcel scanned; B = lane ready; C = supervisor test active [1 for clear definitions]. X = (A AND B) OR C [2 for the two groups and their correct connection].

Question B · Draw [3]

Draw a circuit for X = A AND (B NOR C). Use only gates with two inputs. Describe your wires if you cannot draw here.

Show suggested answer

Connect B and C to a NOR gate [1]. Connect its result and A to an AND gate [1]. Label the final output X and connect the wires correctly [1].

Question C · Derive [4]

A three-input truth table has X = 1 only for input combinations 011 and 100. Write an expression that gives this output. How should a circuit combine the three conditions inside each row?

Show suggested answer

X = (NOT A AND B AND C) OR (A AND NOT B AND NOT C) [3: correct first term, second term and OR]. Use two two-input AND gates in series for three conditions [1].

Exam writing pattern: Define inputs → identify logical groups → write expression with brackets → draw gates → verify the output with a truth table.