Use logic gates to create logic circuits from a problem statement, logic expression or truth table

Cambridge IGCSE Computer Science (0478) – Complete Revision Notes

How the marks are allocated

Assessment ObjectiveWhat it testsTypical weighting
AO1 – Knowledge & understandingRecall of facts, definitions, terminology and basic concepts.≈ 30 %
AO2 – ApplicationUse knowledge to interpret questions, construct tables, write short programmes, draw circuits, etc.≈ 35 %
AO3 – Analysis & evaluationExplain reasoning, justify choices, compare alternatives, optimise solutions.≈ 35 %

1 Computer Systems

1.1 Data representation

  • Binary (base‑2) – each digit is a bit. 8 bits = 1 byte.
  • Denary (base‑10) ↔ Binary
    • Division‑by‑2 method for conversion to binary.
    • Multiplication‑by‑2 method for conversion to denary.
    • Example: 156₁₀ → 10011100₂.
  • Hexadecimal (base‑16) – digits 0‑9 and A‑F.
    • Binary ↔ Hex: group binary in sets of four.
    • Example: 1010 1101₂ → AD₁₆.
  • Binary addition – include overflow flag (carry out of the most‑significant bit).
  • Text – ASCII (7‑bit) or Unicode (up to 21 bits). Example: ‘A’ = 65₁₀ = 01000001₂.
  • Images – bitmap (pixel colour depth) vs vector.
  • Sound – sampled at 44 kHz, 16‑bit gives 2⁴⁴ ≈ 7 × 10⁹ possible values per second.

1.2 Transmission of data

  • Analogue vs digital signals.
  • Bandwidth, latency, error‑checking (parity, checksum, CRC).
  • Common media: twisted‑pair, coaxial, fibre‑optic, wireless (Wi‑Fi, Bluetooth).

1.3 Hardware components

  • CPU – control unit, ALU, registers, cache.
  • Memory hierarchy – primary (RAM), secondary (HDD/SSD), tertiary (magnetic tape, cloud).
  • Input devices (keyboard, mouse, scanner) and output devices (monitor, printer, speaker).
  • Motherboard, bus, power supply, ports.

1.4 Software

  • System software – operating system, device drivers, utility programmes.
  • Application software – word processors, spreadsheets, databases, web browsers.
  • Freeware, shareware, open‑source, proprietary licences.

1.5 The internet & its protocols

  • Client‑server model, IP addressing (IPv4 4 × 8‑bit octets), DNS.
  • Common protocols: HTTP/HTTPS, FTP, SMTP, POP3/IMAP.
  • Security basics – firewalls, encryption (AES, RSA), authentication.

1.6 Emerging technologies

  • Internet of Things (IoT), cloud computing, artificial intelligence, robotics, 3‑D printing.
  • Potential impact on society, ethical considerations, sustainability.

2 Algorithms & Problem Solving (Topic 7)

2.1 The programme development life‑cycle

  1. Analyse the problem.
  2. Design an algorithm (flowchart or pseudocode).
  3. Write the programme.
  4. Test & debug.
  5. Document and maintain.

2.2 Flowchart symbols (Cambridge standard)

SymbolNamePurpose
ProcessAssignment, calculation, I/O.
DecisionTrue/false test.
▶︎Start/StopEntry and exit points.
Input/OutputRead or display data.
LoopRepeated execution (while/for).

2.3 Pseudocode conventions (required by the exam)

  • Variables are written in lower‑case letters.
  • Assignment: var ← expression
  • Input: READ var Output: WRITE expression
  • Decision: IF condition THEN … ENDIF
  • Loop: WHILE condition DO … ENDWHILE or FOR i ← 1 TO n DO … ENDFOR

2.4 Trace tables

Show the values of all variables after each step of an algorithm. Essential for AO2 marks.


3 Programming Concepts (Topic 8)

3.1 Variables, data types & operators

  • Primitive types: INTEGER, REAL, BOOLEAN, CHARACTER, STRING.
  • Operators: arithmetic (+, –, *, /, %), relational (=, ≠, <, >, ≤, ≥), logical (AND, OR, NOT).

3.2 Control structures

  • Sequence – statements executed in order.
  • SelectionIF…THEN…ELSE, CASE.
  • RepetitionWHILE, FOR, REPEAT…UNTIL.

3.3 Arrays (single‑dimensional)

  • Declaration: DIM A(10) AS INTEGER (indices 0‑9 or 1‑10 depending on language).
  • Access: A[i].
  • Common operations – initialise, traverse, search, sort (bubble, insertion).

3.4 File handling (basic)

  • Open a file (OPEN), read/write (READ, WRITE), close (CLOSE).
  • Sequential access only – required for the exam.

4 Databases & SQL (Topic 9)

4.1 Database design basics

  • Single‑table database – primary key uniquely identifies each record.
  • Choose appropriate data types (INTEGER, REAL, CHAR, VARCHAR, DATE).
  • Normalisation is not required for IGCSE, but avoid duplicate columns.

4.2 The five SQL commands examined

CommandPurposeTypical syntax
SELECTRetrieve dataSELECT column1, column2 FROM table WHERE condition;
INSERTAdd a new recordINSERT INTO table (col1, col2) VALUES (val1, val2);
UPDATEModify existing recordsUPDATE table SET col1 = val1 WHERE condition;
DELETERemove recordsDELETE FROM table WHERE condition;
CREATE TABLEDefine a new tableCREATE TABLE table (col1 TYPE, col2 TYPE, …);

4.3 Query‑building tips for the exam

  • Always write column names in the same order as they appear in the table unless SELECT * is used.
  • Remember that WHERE conditions use the same relational operators as in pseudocode.
  • Test your query mentally with a small data set to avoid logical errors.

5 Boolean Logic – Logic Gates (Topic 10)

5.1 Learning objective

Use logic gates to create logic circuits from a problem statement, a Boolean expression, or a truth table.

5.2 Key concepts

  • Boolean variables: 0 = FALSE, 1 = TRUE.
  • Primary operators (exam‑required): AND (·), OR (+), NOT (‾).
    Other gates (XOR, NAND, NOR, XNOR) may appear, but you must be able to rewrite them using only AND, OR, NOT.
  • Truth tables – list the output for every possible combination of inputs.
  • Logic expressions – algebraic form of the required condition.
  • Simplification – Boolean algebra or Karnaugh maps to minimise the number of gates.
  • Implementation – converting an expression or truth table into a circuit diagram.

5.3 Standard Cambridge gate symbols

GateSymbolBoolean function
ANDAND gateA·B
OROR gateA+B
NOTNOT gate‾A
NANDNAND gate‾(A·B)
NORNOR gate‾(A+B)
XORXOR gateA⊕B
XNORXNOR gate‾(A⊕B)

Truth‑table definitions for each gate

GateInputsOutput
ANDA B1 only for 1 1
ORA B0 only for 0 0
NOTA1 when A = 0, 0 when A = 1
NANDA B0 only for 1 1
NORA B1 only for 0 0
XORA B1 for 0 1 and 1 0
XNORA B1 for 0 0 and 1 1

5.4 General design process

  1. Interpret the problem. List every input variable and the exact condition that makes the output true.
  2. Write a Boolean expression. Use AND, OR, NOT (or other gates if given) to model the condition.
  3. Construct a truth table. Include all 2ⁿ rows for n inputs.
  4. Simplify (optional but valuable). Apply Boolean algebra or a Karnaugh map to reduce gate count.
  5. Draw the circuit. Replace each operator in the (simplified) expression with its gate symbol; use only AND, OR, NOT unless you explicitly show the equivalent network.

5.5 Checklist – Common pitfalls

  • ✔️ All possible input combinations must appear in the truth table.
  • ✔️ When an XOR, NAND, NOR, or XNOR is given, write the equivalent expression using only AND, OR, NOT before drawing the final circuit.
  • ✔️ Verify the truth table after every simplification step – a single wrong minterm loses marks.
  • ✔️ Keep the gate count low; a simpler circuit demonstrates AO3 analysis.
  • ✔️ Label inputs and outputs clearly on the diagram.

5.6 Full worked example – Security system

Problem statement

Three sensors A, B and C. The alarm L sounds if sensor A is triggered **and** exactly one of sensors B or C is triggered.

Step 1 – Identify variables

  • A – sensor A (1 = triggered)
  • B – sensor B
  • C – sensor C
  • L – alarm output

Step 2 – Write the Boolean expression

“Exactly one of B or C” is an exclusive‑OR:  \(B⊕C\). Thus

\[ L = A \cdot (B⊕C) \]

If the exam only allows AND, OR, NOT, expand the XOR:

\[ B⊕C = (B + C)\;\cdot\;\overline{(B·C)} \] \[ \therefore\; L = A \cdot \big[(B + C) \cdot \overline{(B·C)}\big] \]

Step 3 – Truth table

ABCB⊕CL = A·(B⊕C)
00000
00110
01010
01100
10000
10111
11011
11100

Step 4 – Simplify (optional)

The expanded form can be rewritten as

\[ L = A\,(B+C)\,(\overline{B}+\overline{C}) \]

which is already the minimal expression for the required function.

Step 5 – Circuit diagram

  • Stage 1: an XOR gate (or the equivalent OR‑AND‑NOT network) receives B and C.
  • Stage 2: an AND gate receives A and the XOR output.
  • The output of the AND gate is L.
Security system circuit – XOR feeding AND with A
Logic circuit for the security system (XOR + AND).

5.7 Practice problem – From a truth table

Given truth table (inputs X, Y, Z; output F):

XYZF
0000
0011
0101
0110
1001
1010
1100
1110
  1. Write the minimal Boolean expression using only AND, OR, NOT (show the steps – sum‑of‑products → Karnaugh map).
  2. Draw the corresponding logic‑gate circuit.

Solution outline (teacher use):

  • Minterms where F = 1: m₁ (001), m₂ (010), m₄ (100).
  • K‑map grouping yields \(\overline{X}Y + \overline{Y}Z + X\overline{Z}\).
  • Circuit: three 2‑input AND gates (each with one NOTed input), one 3‑input OR gate.

5.8 Further practice questions

  1. Write a Boolean expression that outputs 1 only when **exactly two** of the three inputs X, Y, Z are 1. Draw the minimal circuit.
  2. Given the expression \(F = \overline{(P + Q)} \cdot R\), construct the truth table and sketch the circuit using only AND, OR, NOT gates.
  3. Use a Karnaugh map to simplify \(H = \overline{M}N + MN + \overline{M}\overline{N}\) and then draw the simplest possible circuit.

5.9 Summary – How to earn marks for Boolean logic

  • AO1 – State the correct gate symbols and write a clear Boolean expression.
  • AO2 – Produce a complete truth table that matches the problem statement.
  • AO3 – Simplify the expression (fewer gates = higher marks) and justify each step.
  • Translate the final expression into a neat, labelled circuit diagram using the Cambridge symbols.

6 Quick‑Reference Tables

6.1 Binary‑denary‑hex conversion cheat‑sheet

DenaryBinary (8‑bit)Hex
00000000000
10000010100A
15000011110F
25511111111FF
17010101010AA
850101010155

6.2 Boolean algebra identities (exam‑useful)

  • Identity: \(A+0=A,\;A·1=A\)
  • Null law: \(A+1=1,\;A·0=0\)
  • Idempotent: \(A+A=A,\;A·A=A\)
  • Complement: \(A+‾A=1,\;A·‾A=0\)
  • Distributive: \(A·(B+C)=A·B+A·C\)
  • De Morgan: \(‾(A·B)=‾A+‾B,\;‾(A+B)=‾A·‾B\)

6.3 Common pseudocode patterns

TaskPseudocode
Maximum of three numbers READ a, b, c
IF a > b AND a > c THEN max ← a
ELSE IF b > c THEN max ← b
ELSE max ← c
WRITE max
Count how many of X, Y, Z are true count ← 0
IF X = 1 THEN count ← count + 1
IF Y = 1 THEN count ← count + 1
IF Z = 1 THEN count ← count + 1
WRITE count

7 Final Tips for Exam Day

  • Read the question **twice** – underline the exact condition to be modelled.
  • Start with a clear list of variables; use the same letters throughout.
  • When a truth table is given, double‑check the number of rows (2ⁿ).
  • For Boolean simplification, work on paper first; a clean K‑map gains marks for method.
  • Label every gate, input and output in your circuit diagram – missing labels cost marks.
  • Allocate time: 5 min for interpretation, 8 min for expression & truth table, 5 min for simplification, 7 min for drawing the circuit.

Create an account or Login to take a Quiz

46 views
0 improvement suggestions

Log in to suggest improvements to this note.