boolean logic
boolean logic
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
AND
Expression Circuit symbol Explanation
operator
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
© 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
© 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:
© 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
A B NOT (A AND
B)
0 0 1
0 1 1
1 0 1
1 1 0
© 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
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
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
© 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
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
The logic circuit above can be expressed as the logic expression Q= NOT(A OR B)
The logic circuit above can be expressed as the logic expression Q= (NOT A) AND B
The logic circuit above can be expressed as the logic expression P = ((NOT A) OR B)
NAND C
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 15
Your notes
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