EEasy IGCSELabTracker

On a phone the notes, quizzes and tracker work fine. The 3D models and the practice lab are made for a laptop.

Specification points 10.1–10.3 ·

the six logic gates, and converting between problem statements, logic expressions, logic circuits and truth tables.

1Logic gates and truth tables

Definition

Logic gate — a component that takes binary inputs (0 or 1) and produces one binary output according to a fixed rule.

Truth table — a table showing the output for every possible combination of binary inputs.

Logic circuit — logic gates connected together; the output of one gate becomes an input of the next.

Logic expression — a circuit written with the gate names and brackets, e.g. X = (A AND B) OR NOT C.

NOT X = NOT A A X A X 0 1 1 0 Output is the opposite of the input AND X = A AND B A B X A B X 0 0 0 0 1 0 1 0 0 1 1 1 1 only if both inputs are 1 OR X = A OR B A B X A B X 0 0 0 0 1 1 1 0 1 1 1 1 1 if either input or both inputs are 1 NAND X = A NAND B A B X A B X 0 0 1 0 1 1 1 0 1 1 1 0 NOT AND: 0 only if both inputs are 1 NOR X = A NOR B A B X A B X 0 0 1 0 1 0 1 0 0 1 1 0 NOT OR: 1 only if both inputs are 0 XOR (EOR) X = A XOR B A B X A B X 0 0 0 0 1 1 1 0 1 1 1 0 1 if the inputs are different
Figure 1. The six gates: standard symbol, logic expression, truth table and rule. NOT is the only single-input gate; every other gate has exactly two inputs. A small circle (bubble) on the output means NOT.

Switch the inputs of each gate

Loading the interactive…

Building a truth table. n inputs give 2n rows: 2 inputs → 4 rows, 3 inputs → 8 rows (exam circuits have at most three inputs and one output). List the rows in binary counting order, 000, 001, 010 … 111: the right-hand input column alternates 0 1 0 1, the middle one goes in pairs, the left-hand one in fours.

2From a logic circuit: truth table and expression

A B C P Q X
Figure 2. B feeds two gates: the dot marks a junction. Wires that cross without a dot are not connected.

Trace the circuit

Loading the interactive…

Truth table

Label the output of every gate except the last (P, Q …). Fill a working column for each, row by row, using the rules in Figure 1; then use those columns as the inputs of the final gate.

P = A NAND B · Q = B NOR C · X = P XOR Q

A B C P Q X
0 0 0 1 1 0
0 0 1 1 0 1
0 1 0 1 0 1
0 1 1 1 0 1
1 0 0 1 1 0
1 0 1 1 0 1
1 1 0 0 0 0
1 1 1 0 0 0

Logic expression. Work from the inputs towards the output. Write each gate as (input GATE input); where an input comes from another gate, put that gate's bracket in its place: P = (A NAND B), Q = (B NOR C), so X = (A NAND B) XOR (B NOR C).

3From a logic expression: circuit and truth table

  1. Find the final gate: the operator outside all the brackets produces X.
  2. Build the brackets first: each bracketed part is a gate (or small group of gates) whose output feeds the next gate out.
  3. Every NOT is its own NOT gate. Draw exactly what is written, without simplification: NOT (B XOR C) is an XOR gate followed by a NOT gate.

Example: X = (A OR NOT B) AND NOT (B XOR C) — the final gate is the AND.

A B C P Q X
Figure 3. P = A OR NOT B and Q = NOT (B XOR C) are the two inputs of the final AND gate.

Build the circuit from the expression

Loading the interactive…

The truth table can be filled straight from the expression, one working column per part — which is also how to check a circuit you have drawn:

A B C NOT B P = A OR NOT B B XOR C Q = NOT (B XOR C) X = P AND Q
0 0 0 1 1 0 1 1
0 0 1 1 1 1 0 0
0 1 0 0 0 1 0 0
0 1 1 0 0 0 1 0
1 0 0 1 1 0 1 1
1 0 1 1 1 1 0 0
1 1 0 0 1 1 0 0
1 1 1 0 1 0 1 1

4From a problem statement: expression, circuit and truth table

Reading the statement

Each input has a meaning for 1 and for 0. Turn each condition into a bracket, then join the brackets with the linking word.

Wording Gate
"and", "both" AND
"or", "either … or both" OR
"not", or the 0 meaning of an input NOT
"either … or … but not both", "only one of" XOR
"neither … nor" NOR
"not both" NAND
Example

A greenhouse window opens (X = 1) when either the temperature is above 30 °C and it is not raining, or the humidity is high and the temperature is not above 30 °C.

Input 1 means 0 means
T > 30 °C ≤ 30 °C
H humidity high not high
R raining not raining
R T H P Q X
Figure 4. T feeds the first AND gate directly and the second AND gate through a NOT gate.
Method
  1. Conditions: P = (T AND NOT R) and Q = (H AND NOT T).
  2. Linking word "or": X = (T AND NOT R) OR (H AND NOT T).
  3. Circuit: draw the expression with the §3 method (Figure 4).
  4. Truth table: inputs in the order the question gives them (T, H, R).
T H R P Q X
0 0 0 0 0 0
0 0 1 0 0 0
0 1 0 0 1 1
0 1 1 0 1 1
1 0 0 1 0 1
1 0 1 0 0 0
1 1 0 1 0 1
1 1 1 0 0 0

5From a truth table: expression and circuit

Method
  1. Pick out every row where X = 1.
  2. For each of those rows write one AND term: the input name if it is 1, NOT + the input name if it is 0.
  3. Join the terms with OR.

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

A gate has at most two inputs, so each three-input term needs two AND gates in a chain.

A B C X Term
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1 NOT A AND B AND C
1 0 0 0
1 0 1 0
1 1 0 1 A AND B AND NOT C
1 1 1 0
A B C X NOT A AND B AND C A AND B AND NOT C
Figure 5. One chain of two AND gates per row where X = 1; an OR gate joins the chains. With three rows giving X = 1, use two OR gates in a chain.
Traps
  • OR vs XOR: they differ only when both inputs are 1 — OR gives 1, XOR gives 0.
  • NAND and NOR give the exact opposite of AND and OR on every row. NOT (A AND B) is a NAND, not NOT A AND NOT B.
Exam language
  • "Do not attempt to simplify": one gate per operator in the statement or expression, in the order given — including every NOT.
  • Write a logic expression with the gate names and brackets around each gate's inputs, starting with the output: X = (A NAND B) XOR (B NOR C).

Quick check

14 multiple-choice questions. Pick an answer to see whether it is right and why.

  1. How many rows does the truth table of a logic circuit with three inputs have?

  2. Both inputs of a gate are 1. Which gate gives the output 1?

  3. How many of the four rows of the truth table for A NAND B have the output 1?

  4. Which two gates give different outputs only when both inputs are 1?

  5. A three-input truth table lists its rows in binary counting order. Which row comes straight after 0 1 1?

  6. X = (A AND B) OR NOT C. For which inputs is X = 0?

  7. X = (A XOR B) AND C. How many of the eight rows of its truth table have X = 1?

  8. In a logic circuit, A and B are the inputs of a NOR gate; its output and C are the inputs of an AND gate that gives X. What is the logic expression?

  9. How many gates are needed to draw X = (A AND NOT B) OR NOT (B XOR C) without simplification?

  10. A light is on (X = 1) when either switch A or switch B is on, but not both. Which gate does this describe?

  11. A fan runs (X = 1) when the room is hot (H = 1) and the window is not open (W = 1 means open). What is the logic expression?

  12. In a truth table X is 1 for the row A = 1, B = 0, C = 1. Which AND term is written for this row?

  13. A three-input truth table has X = 1 in exactly two rows. Built by the method in the notes, how many AND gates does the circuit need?

  14. Which single gate gives the same output as NOT (A AND B)?

Exam-style questions

Write your answer, then show the answer and compare. Nothing here is marked for you: you decide how close you were. What you write is saved in this browser.

Questions

1

(10.1, 10.2) Identify the gate described.

(a) The output is 1 only when both inputs are 0.
(b) The output is 0 only when both inputs are 1.
(c) The output is 1 when the two inputs are different.
(d) The gate has only one input.

4 marks
2

(10.2) Draw the standard symbols for a NAND gate and an XOR gate.

2 marks
3

(10.3 b(iii), c(ii)) Look at this logic circuit.

A B C X

(a) Complete the truth table for the circuit (A, B, C in the order 000 … 111). [4]
(b) Write the logic expression for the circuit. Do not attempt to simplify it. [3]

7 marks
4

(10.3 b(iii), c(ii)) Look at this logic circuit.

A B C X

(a) Write the logic expression for the circuit. Do not attempt to simplify it. [3]
(b) Complete the truth table for the circuit. [4]

7 marks
5

(10.3 a(ii), b(ii)) X = (A AND NOT B) NOR (B OR C)

(a) Draw the logic circuit. Each gate must have no more than two inputs. Do not simplify. [4]
(b) Complete the truth table. [4]

8 marks
6

(10.3 a(i), b(i), c(i)) A water pump runs (X = 1) when the tank is not full and either the manual switch is on or the timer is on, but not both.

Input 1 means 0 means
F tank full tank not full
S switch on switch off
T timer on timer off

(a) Write the logic expression. [2]
(b) Draw the logic circuit. [3]
(c) Complete the truth table (F, S, T in the order 000 … 111). [4]

9 marks
7

(10.3 c(iii), a(iii)) The output X of a circuit is 1 only for these inputs: A B C = 000, 101 and 111; it is 0 for every other row.

(a) Write a logic expression for X. [3]
(b) Draw a logic circuit for X using gates with no more than two inputs. [4]

7 marks
8

(10.2) A student says NOT (A AND B) always gives the same output as NOT A AND NOT B. Use a truth table to show the student is wrong.

3 marks

How well do you know this?

Rate each specification point. It is saved to your tracker as a new revision round.

All points:
  • 10.1Identify and use the standard symbols for logic gates
  • 10.2Define and understand the functions of logic gates

Settings

Your subjects

Untick the subjects you don't take. They leave the menu, the home page and the tracker. Your ratings are kept, so you can bring a subject back at any time.

Page style

Colours