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

3.2.2 From Problem Statements to Logic Circuits

A worded rule describes conditions and an outcome. To implement that rule as digital hardware, the conditions must first become Boolean inputs, then a logic expression, and finally a connected arrangement of gates.

This lesson develops one reliable route: problem statement → labelled propositions → logic expression → logic circuit. The reverse translations are covered in the next section.

By the end of this section, you should be able to:

  • Separate Boolean conditions from the outcome in a problem statement.
  • Assign clear input symbols and define the output.
  • Select AND, OR, NOT, NAND, NOR or XOR from the meaning of the rule.
  • Use brackets to preserve the intended grouping of conditions.
  • Translate a logic expression into a left-to-right gate circuit.
  • Build multi-stage circuits using gates with no more than two inputs.
  • Check a circuit using carefully chosen test cases.

The anatomy of a logic problem

A useful problem statement contains two different kinds of information:

Part Meaning Example
Conditions Statements that can each be represented as 0 or 1. A staff badge is valid. Lockdown is active. Supervisor override is enabled.
Outcome The result produced when the required combination of conditions is met. Unlock the equipment cabinet.
Logic proposition: a statement that has one of two values, TRUE or FALSE.
Logic expression: propositions combined using Boolean operators to define an output.

Common mistake

Do not assign a symbol to an action such as “scan the card”. Assign symbols to conditions that have a stable Boolean meaning, such as “the scanned card is valid”.

A four-stage construction method

An original workflow for constructing a circuit. Select the image to enlarge it.
  1. Extract: identify every condition that can be true or false and separate these conditions from the outcome.
  2. Label: assign one symbol to each condition and another symbol, often X, to the output.
  3. Group: choose the Boolean operators and write an expression with brackets that preserve the intended meaning.
  4. Build: draw one gate for each operation and connect intermediate outputs towards the final output.

Exam tip

Do not jump directly from the paragraph to a circuit. A written expression gives you a plan and makes omitted NOT gates or incorrect groupings easier to detect.

Reading the wording carefully

Everyday language does not always name the operator directly. The following phrases often suggest a particular Boolean relationship.

Wording Likely operation Interpretation
both, together, only when each condition is met AND Every listed condition must be 1.
either condition is sufficient, at least one OR One or both conditions may be 1.
not, inactive, unavailable, outside the limit NOT The stated condition is inverted.
one of the two, but not both XOR The two inputs must be different.
not both NAND The output is 0 only for input pair 11.
neither condition NOR The output is 1 only for input pair 00.

Language warning

The word or is normally inclusive in Boolean logic. Use XOR only when the wording clearly excludes the case where both conditions are true.

Worked example: equipment cabinet access

The cabinet unlocks when a staff badge is valid and maintenance lockdown is not active. A supervisor override can also unlock it.

Step 1: Identify the conditions and outcome

Symbol Meaning when the value is 1
AThe staff badge is valid.
BMaintenance lockdown is active.
CSupervisor override is enabled.
XThe equipment cabinet unlocks.

Step 2: Translate each part

Worded part Boolean form
A valid badge and lockdown is not active A AND NOT B
That route, or supervisor override (A AND NOT B) OR C

Step 3: Write the complete expression

X = (A AND NOT B) OR C

The brackets show that A must first be combined with the inverted B input. The result of that stage is then combined with C.

From the expression to the circuit

Read the expression from the innermost operation towards the final output:

  1. Pass B through a NOT gate.
  2. Feed A and NOT B into an AND gate.
  3. Feed the AND output and C into an OR gate.
  4. Label the OR output X.
Original circuit for the equipment-cabinet rule. Select the image to enlarge it.

Exam tip

Draw inputs on the left and the final output on the right. Keep wires separate, label every external input, and place inversion before the gate that needs the complemented value.

Why grouping and brackets matter

The same letters and operators can describe different systems when they are grouped differently.

Expression First operation Meaning
X = (A AND B) OR C Combine A and B with AND. C can make X = 1 by itself.
X = A AND (B OR C) Combine B and C with OR. A must be 1 in every case where X = 1.
X = NOT (A OR B) Combine A and B with OR, then invert. This is a NOR relationship.
X = (NOT A) OR B Invert only A. B is not affected by the NOT operation.

Common mistake

NOT (A OR B) is not the same as (NOT A) OR B. A NOT gate affects only the signal or grouped result connected to it.

Building with two-input gates

In this course, gates other than NOT are treated as two-input gates. If three or more conditions use the same operator, combine them in stages.

Example: X = A OR B OR C

  1. Create an OR gate for A and B.
  2. Connect that intermediate result to one input of a second OR gate.
  3. Connect C to the other input.
  4. The second OR gate produces X.
Expression part Intermediate signal
A OR BP = A OR B
P OR CX = P OR C

Exam tip

You do not need to label every intermediate wire unless it helps clarity, but each Boolean operation in the expression must be represented by a gate or an equivalent gate.

Interactive prerequisite: Boolean Operator Lab

Use this retained widget to check how one operator responds before using it inside a larger expression.

Input A
Input B
Expression A AND B
Output FALSE

AND is TRUE only when both inputs are TRUE.

Interactive: Problem Statement to Circuit Plan

The original widget structure has been retained, but its scenarios and logic have been independently rebuilt. Select a situation to inspect the conditions, symbols, expression, and gate-building sequence.

Equipment cabinet access

Unlock the cabinet if a staff badge is valid and lockdown is not active, or if a supervisor override is enabled.

1. Conditions

2. Symbols

3. Expression and circuit plan

X = (A AND NOT B) OR C

Invert B; AND the result with A; OR that result with C.

Checking a circuit with selected cases

A few carefully chosen inputs can expose common construction errors before a full truth table is produced.

A B C Expected X Reason
1001 The valid badge route succeeds because lockdown is not active.
1100 Lockdown blocks the badge route.
0111 Supervisor override succeeds independently.
0000 No unlocking route is active.

These cases do not replace the full truth-table method taught in 3.2.3, but they are useful design checks.

Exam support

Write definitions before drawing

State what each input means when its value is 1. This prevents accidental inversion of a condition such as door locked versus door unlocked.

Follow the expression structure

Start with bracketed or NOT operations, create intermediate results, and work towards the final output.

Do not simplify unless asked

When given a specific expression, construct that expression faithfully. Equivalent simplification is a separate skill and may obscure the required working.

Common mistakes and misconceptions

  • Using the outcome as an input proposition.
  • Assigning symbols before deciding exactly what a value of 1 means.
  • Using OR when every condition is required.
  • Forgetting a NOT gate for wording such as “not active”.
  • Ignoring brackets and connecting gates in the wrong grouping.
  • Drawing a three-input gate when the course expects two-input gates.
  • Leaving input or output wires unlabelled.

Practice

Build expressions first

  1. A ventilation fan starts if the room is occupied and the carbon-dioxide level is high.
  2. A warning light activates if the access panel is open or the battery is low.
  3. A test signal is accepted if exactly one of two sensors is active.
  4. A pump starts if the tank is not empty and irrigation is requested.

For each statement, define the inputs and output, then write a logic expression.

Original circuit-construction task

A drone may take off if GPS lock is available and the battery is ready. Test mode can also authorise take-off.

  1. Identify the three propositions.
  2. Assign A, B, and C.
  3. Write an expression for output X.
  4. Describe the gate sequence.
  5. Draw the circuit using two-input gates.

Find the interpretation error

Rule: “Sound the alarm when neither the front sensor nor the rear sensor is active.”

A student writes X = A OR B. Explain the error and provide a correct expression.

Grouping challenge

Explain how the circuits for (A AND B) OR C and A AND (B OR C) must differ.

Review

Stage Question to ask
Extract Which statements can each be 0 or 1, and what is the required output?
Label What does a value of 1 mean for A, B, C and X?
Group Which operators match the wording, and where are brackets needed?
Build Which gate represents each operation, and in what order are the results combined?
Check Do selected input cases produce outcomes that match the original rule?