Logic Expressions (Cambridge (CIE) O Level Computer Science)
Revision Note
![James Woodhouse](https://www.savemyexams.com/cdn-cgi/image/f=auto,width=3840/https://cdn.savemyexams.com/uploads/2024/01/james-profile-pic.jpg)
Author
James WoodhouseExpertise
Computer Science
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 | ![]() |
| Z = NOT A | |||||||||||||||
AND | ![]() |
| Z = A AND B | |||||||||||||||
OR | ![]() |
| Z = A OR B | |||||||||||||||
NAND | ![]() |
| Z = A NAND B | |||||||||||||||
NOR | ![]() |
| Z = A NOR B | |||||||||||||||
XOR | ![]() |
| Z = A XOR B |
Logic circuits containing multiple gates can also be expressed as logic expressions/statements
An example logic circuit containing two inputs
![screenshot-2023-05-30-at-09-28-55](https://cdn.savemyexams.com/cdn-cgi/image/f=auto,width=3840/https://cdn.savemyexams.com/uploads/2023/05/screenshot-2023-05-30-at-09-28-55.png)
The logic circuit above can be expressed as the logic expression Q= NOT(A OR B)
An example logic circuit containing two inputs
![screenshot-2023-05-30-at-09-29-06](https://cdn.savemyexams.com/cdn-cgi/image/f=auto,width=3840/https://cdn.savemyexams.com/uploads/2023/05/screenshot-2023-05-30-at-09-29-06.png)
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
![screenshot-2023-05-30-at-09-35-30](https://cdn.savemyexams.com/cdn-cgi/image/f=auto,width=3840/https://cdn.savemyexams.com/uploads/2023/05/screenshot-2023-05-30-at-09-35-30.png)
This logic circuit above can be expressed as X = NOT (A NAND B) OR (B NOR C)
Exam Tip
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
![screenshot-2023-05-30-at-09-37-21](https://cdn.savemyexams.com/cdn-cgi/image/f=auto,width=3840/https://cdn.savemyexams.com/uploads/2023/05/screenshot-2023-05-30-at-09-37-21.png)
One mark per correct logic gate, with the correct input
You've read 0 of your 0 free revision notes
Get unlimited access
to absolutely everything:
- Downloadable PDFs
- Unlimited Revision Notes
- Topic Questions
- Past Papers
- Model Answers
- Videos (Maths and Science)
Did this page help you?