Cambridge (CIE) IGCSE Your notes
Computer Science
Boolean Logic
Contents
Logic Gates
Logic Circuits
Truth Tables
Logic Expressions
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 1
Logic Gates
Your notes
Logic gates
What is Boolean logic?
Boolean logic is used in computer science and electronics to make logical decisions
Boolean operators are either TRUE or FALSE, often represented as 1 or 0
Inputs and outputs are given letters to represent them
To define Boolean logic we use special symbols to make writing
expressions much easier
What are logic gates?
Logic gates are a visual way of representing a Boolean expression
The logic gates covered in this course are:
AND
OR
NOT
XOR
NAND
NOR
AND
Expression Circuit symbol Explanation
operator
(A AND B) Returns TRUE only if both inputs are
TRUE
TRUE AND TRUE = TRUE
Otherwise = FALSE
OR
Expression operator Circuit symbol Explanation
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 2
(A OR B) Returns TRUE if either input is TRUE
TRUE OR FALSE = TRUE Your notes
FALSE OR FALSE = FALSE
NOT
Expression operator Circuit symbol Explanation
(NOT A) Reverses the input value
NOT TRUE = FALSE
NOT FALSE = TRUE
XOR (exclusive OR)
Expression Circuit symbol Explanation
operator
(A XOR B) Returns TRUE if either input is TRUE but
NOT both
TRUE OR FALSE = TRUE
FALSE OR FALSE = FALSE
TRUE OR TRUE = FALSE
NAND (not and)
Expression Circuit symbol Explanation
operator
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 3
(A NAND B) Returns TRUE if either or
both inputs are FALSE
Your notes
TRUE OR FALSE = TRUE
FALSE OR FALSE = TRUE
TRUE OR TRUE = FALSE
NOR (not OR)
Expression Circuit symbol Explanation
operator
(A NOR B) Returns TRUE if both
inputs are FALSE
TRUE OR FALSE = FALSE
FALSE OR FALSE = TRUE
TRUE OR TRUE = FALSE
Examiner Tips and Tricks
You will need to either draw a diagram of a logic circuit using these symbols, or you will
have to write the boolean expression from an existing diagram.
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 4
Logic Circuits
Your notes
Logic Circuits
What is a logic circuit?
A logic circuit performs logical operations on binary information
Logic gates are core components of logic circuits
Based on the arrangement of logic gates and the input signals, the circuit performs a
specific function
A logic diagram is a visual representation of a combinations of logic gates within a logic
circuit
Brackets are used to clarify the order of operations
An example logic diagram for the Boolean expression Q = NOT(A OR B) would be:
In the logic diagram above, the inputs are represented by A and B
P is the output of the OR gate on the left and becomes the input of the NOT gate
Q is the final output of the logic circuit
Examiner Tips and Tricks
You may be asked to draw a logic circuit from a logic statement or a Boolean
expression OR write the logical expression that is expressed in the logic diagram
using Boolean expression operators
Logic circuits will be limited to a maximum of three inputs and one output
Example of combining logic gates
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 5
Your notes
P = (A OR B) AND NOT C
Worked Example
A sprinkler system switches on if it is not daytime (input A) and the temperature is
greater than 40 (input B)
Draw a logic circuit to represent the problem statement above
[2]
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 6
Truth Tables
Your notes
Truth Tables
What is a truth table?
A truth table is a tool used in logic and computer science to visualise the results of
Boolean expressions
They represent all possible inputs and the associated outputs for a given Boolean
expression
AND
Circuit symbol Truth Table
A B A AND
B
0 0 0
0 1 0
1 0 0
1 1 1
OR
Circuit symbol Truth Table
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 7
A B A OR
B Your notes
0 0 0
0 1 1
1 0 1
1 1 1
NOT
Circuit symbol Truth Table
A NOT
0 1
1 0
XOR (exclusive)
Circuit symbol Truth Table
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 8
A B A XOR
B Your notes
0 0 0
0 1 1
1 0 1
1 1 0
NAND (not and)
Circuit symbol Truth Table
A B NOT (A AND
B)
0 0 1
0 1 1
1 0 1
1 1 0
NOR (not or)
Circuit symbol Truth Table
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 9
A B NOT (A OR
B) Your notes
0 0 1
0 1 0
1 0 0
1 1 0
Truth Tables for Logic Circuits
How do you create truth tables for logic circuits?
To create a truth table for the expression P = (A AND B) AND NOT C
Calculate the numbers of rows needed (2number of inputs)
In this example there are 3 inputs (A, B, C) so a total of 8 rows are needed (23)
To not miss any combination of inputs, start with 000 and count up in 3-bit binary
(0-7)
A B C
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 10
1 1 1
Your notes
Add a new column to show the results of the brackets first (A AND B)
A B C A AND B
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 1
1 1 1 1
Add a new column to show the results of NOT C
A B C A AND B NOT C
0 0 0 0 1
0 0 1 0 0
0 1 0 0 1
0 1 1 0 0
1 0 0 0 1
1 0 1 0 0
1 1 0 1 1
1 1 1 1 0
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 11
The last column shows the result of the Boolean expression (P) by comparing (A AND B)
AND NOT C // A B C
( . .
)
Your notes
A B C A AND B NOT C P
0 0 0 0 1 0
0 0 1 0 0 0
0 1 0 0 1 0
0 1 1 0 0 0
1 0 0 0 1 0
1 0 1 0 0 0
1 1 0 1 1 1
1 1 1 1 0 0
Examiner Tips and Tricks
It is possible to create a truth table when combining expressions that show only the
inputs and the final outputs.
The inclusion of the extra columns supports the process but can be skipped if you feel
able to do those in your head as you go.
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 12
Logic Expressions
Your notes
Logic Expressions
A logic expression is a way of expressing a logic gate or logic circuit as an equation
The output appears on the left of the equals sign with the inputs and logic gates on the
right
Gate Symbol Truth Table Logic
Expression
NOT A Z Z = NOT A
0 1
1 0
AND A B Z Z = A AND B
0 0 0
0 1 0
1 0 0
1 1 1
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 13
OR A B Z Z = A OR B
Your notes
0 0 0
0 1 1
1 0 1
1 1 1
NAND A B Z Z = A NAND B
0 0 1
0 1 1
1 0 1
1 1 0
NOR A B Z Z = A NOR B
0 0 1
0 1 0
1 0 0
1 1 0
XOR A B Z Z = A XOR B
0 0 0
0 1 1
1 0 1
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 14
1 1 0
Your notes
Logic circuits containing multiple gates can also be expressed as logic
expressions/statements
An example logic circuit containing two inputs
The logic circuit above can be expressed as the logic expression Q= NOT(A OR B)
An example logic circuit containing two inputs
The logic circuit above can be expressed as the logic expression Q= (NOT A) AND B
An example logic circuit containing three inputs
The logic circuit above can be expressed as the logic expression P = ((NOT A) OR B)
NAND C
An example logic circuit containing three inputs
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 15
Your notes
This logic circuit above can be expressed as X = NOT (A NAND B) OR (B NOR C)
Examiner Tips and Tricks
You may be required to write a logic expression/statement from a truth table or a
logic circuit. You may also have to do the opposite - draw a logic circuit and
complete a truth table for a logic expression
Worked Example
Consider the logic statement: X = (((A AND B) OR (C AND NOT B)) XOR NOT C)
a. Draw a logic circuit to represent the given logic statement. [6]
Answer
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 16
Your notes
One mark per correct logic gate, with the correct input
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 17