10.3 Logic circuits, logic expressions, truth tables and problem statements

← Topic 10.2 The function of the six logic gatesComputer Science contentsEnd of Chapter 10 · Boolean logic
Chapter 10 · Boolean logic

10.3 Logic circuits, logic expressions, truth tables and problem statements

This final topic brings the whole Boolean-logic chapter together. You need to move confidently between logic circuits, logic or Boolean expressions, truth tables and real problem statements.

Logic circuitsExpressionsTruth tablesProblem statementsWorked examples

What Topic 10.3 expects you to do

The textbook organises this topic around eight worked examples. Across them, you must be able to perform three-way conversions:

Starting informationYou may be asked to produce
Problem statementLogic circuit, truth table, logic/Boolean expression
Logic/Boolean expressionLogic circuit and truth table
Truth tableLogic/Boolean expression and logic circuit
Logic circuitTruth table and logic/Boolean expression
Boolean symbols used in the source: a dot means AND, a plus sign means OR, and a bar over a letter or group means NOT. Logic-word notation such as A AND B is equally useful for following the worked methods.

Logic circuit → truth table

Example 1: trace a circuit in stages

When a circuit contains several gates, do not try to calculate the final output in one jump. The book splits the circuit into stages and gives intermediate outputs names such as P, Q and R. With three inputs there are 2³ = 8 possible input combinations, so the final truth table needs eight rows.

Figure 10.8 from the textbook showing a multi-stage logic circuit divided into three parts

For the circuit in Figure 10.8:

Figure 10.9 showing the first stage of the circuit
Figure 10.10 showing P and Q feeding the next gate
Figure 10.11 showing the final stage of the circuit
ABCPQRX
0000111
0010001
0100000
0110001
1000111
1010001
1101011
1111010
Exam method: keep intermediate columns while you are working. Once confident, the final answer can be reduced to just the input columns and X, but the intermediate columns make errors much easier to find.
Practise tracing a multi-gate circuit.

Logic circuit → logic expression

Example 2: work from the input side towards the output

Start with the gates directly connected to the inputs. Write an expression for each of these first. Then replace each intermediate gate with its expression as you move towards the output.

Figure 10.12 from the textbook showing a three-gate circuit

Figure 10.12

Gate 1 gives (A AND B). Gate 2 gives (B OR C). Gate 3 joins those results using XOR.

Final expression: (A AND B) XOR (B OR C).

Figure 10.13 from the textbook showing a four-gate circuit

Figure 10.13

The source works through the gates in order: (A NAND C) and (B AND C) first, then applies NOR with A, before the final OR.

Final expression: ((A NAND C) NOR A) OR (B AND C).

Activity 10.2: practise with the original circuits

The textbook then gives a set of circuits for students to convert into truth tables and expressions. The original figures are kept here so you practise with the same visual gate symbols and wiring style.

Figure 10.14 logic-circuit activity
Figure 10.15 logic-circuit activity
Figure 10.16 logic-circuit activity
Figure 10.17 logic-circuit activity
Figure 10.18 logic-circuit activity
Figure 10.19 logic-circuit activity
Figure 10.20 logic-circuit activity
Check how you translate a circuit into an expression.

Logic expression → circuit and truth table

Example 3: build the expression one bracket at a time

The source expression is (A XOR C) OR (NOT C NAND B). The outermost operation is OR, so the two bracketed parts can be built separately and then joined with an OR gate.

Figure 10.21 showing the A XOR C part
Figure 10.22 showing the NOT C NAND B part
Figure 10.23 showing the complete circuit for Example 3
ABCPQRX
0000111
0011011
0100100
0111011
1001111
1010011
1101101
1110011
Reliable construction rule: brackets closest to the inputs become the earliest gates. Work outwards until the final operation becomes the last gate before X.
Build circuits from expressions.

Truth table → expression and circuit

Example 4: use the rows where X = 1

The book's method is to look only at rows where the output is 1. For each such row, write an AND expression that exactly describes the input pattern. An input of 0 is written as NOT that input. If more than one row produces 1, join the row expressions using OR.

Figure 10.24 showing the circuit for A AND NOT B

For the first table, only A = 1 and B = 0 produces X = 1, giving A AND NOT B.

Figure 10.25 showing the circuit for two truth-table rows joined with OR

For the second table, two rows produce X = 1, giving (NOT A AND B) OR (A AND B).

Example 5: three-input truth tables

With three inputs, each output-1 row becomes a three-part AND expression. For example, the first truth table in the source produces:

Expression from the output-1 rows

(NOT A AND NOT B AND NOT C) OR (A AND NOT B AND NOT C) OR (A AND B AND NOT C)

The second example uses four output-1 rows. The source then proves by truth table that the longer expression gives the same outputs as the shorter expression (B AND C) OR (A AND C) OR (A AND B).

Key idea: for an output-1 row, a 1 means use the input itself; a 0 means use NOT input. AND the inputs within that row, then OR together all the rows that produce 1.
Practise reading truth tables backwards.

Problem statement → expression, circuit and truth table

Example 6: convert ON/OFF wording into logic

The safety-system statement says the alarm X sounds if A is ON and B is OFF, or if B is ON and C is OFF. Since ON = 1 and OFF = 0, OFF is represented by NOT.

Logic expression: (A AND NOT B) OR (B AND NOT C).
Figure 10.26 showing the two parts of the safety-system logic
Figure 10.27 showing the complete safety-system circuit
ABCA AND NOT BB AND NOT CX
000000
001000
010011
011000
100101
101101
110011
111000

Example 7: wind-turbine safety system

First translate the physical conditions into the binary meanings given in the table. The three shutdown conditions become:

Because the original conditions are joined by OR, the three sub-circuits are ORed together.

Figure 10.28 wind-turbine first condition
Figure 10.29 wind-turbine second condition
Figure 10.30 wind-turbine third condition
Figure 10.31 combining two wind-turbine conditions
Figure 10.32 complete wind-turbine safety circuit
STWNOT S AND TS AND WNOT T AND WX
0000000
0010011
0101001
0111001
1000000
1010111
1100000
1110101
Practise turning real conditions into Boolean logic.

Further textbook practice in Topic 10.3

The source then provides additional problems involving chemical-process alarms, power-station shutdown systems, car engine-management warnings and further expressions/truth tables. The important method is always the same:

  1. Translate each physical condition into a binary meaning.
  2. Look for AND, OR and conditions that require NOT.
  3. Write the expression in manageable parts.
  4. Draw the circuit from those parts.
  5. Complete all possible input rows in the truth table.
  6. Use the truth table to check that the expression and circuit agree.
Use a source-style scenario without leaving the notes.

Topic 10.3 revision checklist

Complete a truth table from a logic circuit by using intermediate columns.
Write a logic expression by reading a circuit from its input gates towards the output.
Build a logic circuit from a bracketed logic/Boolean expression.
Use output-1 rows of a truth table to produce a logic expression.
Translate ON/OFF and numerical conditions in a problem statement into binary logic.
Use AND, OR and NOT correctly when combining real-world conditions.
Check that a circuit, expression and truth table all describe the same behaviour.
Know that three inputs require eight truth-table rows.
Ready for the final Chapter 10 check?
← Topic 10.2 The function of the six logic gatesComputer Science contentsEnd of Chapter 10 · Boolean logic