Boolean Logic (OCR A Level Computer Science)
Revision Note
Author
Neil SouthinExpertise
Computer Science
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
Combination of Boolean operators
Can be combined to form more complex expressions
Use parentheses to clarify the order of operations
Example: NOT (TRUE AND FALSE) = TRUE
Evaluating Boolean expressions
There is a specific sequence for evaluating expressions with multiple operators just like in normal maths where BIDMAS applies
Brackets come first then NOT then AND then OR
Using Brackets can alter the standard order of operations
Expressions within parentheses are evaluated first, following the same NOT, AND, OR precedence inside the parentheses
Example: NOT (TRUE AND FALSE) equals NOT FALSE, which equals TRUE
Logic Gates
Logic gates are a visual way of representing a Boolean expression
The logic gates covered in this course are:
Conjunction (AND)
Disjunction (OR)
Negation (NOT)
Exclusive disjunction (XOR)
Conjunction (AND)
Operation | Circuit symbol | Notes |
---|---|---|
A ∧ B A . B | Returns TRUE only if both inputs are TRUE TRUE AND TRUE = TRUE Otherwise = FALSE Next highest precedence after NOT Executes before OR operations |
Disjunction (OR)
Operation | Circuit symbol | Explanation |
---|---|---|
A∨B A+B | Returns TRUE if either input is TRUE TRUE OR FALSE = TRUE FALSE OR FALSE = FALSE Lowest precedence in Boolean expressions Executes after NOT and AND operations |
Negation (NOT)
Symbol | Circuit symbol | Notes |
---|---|---|
¬A | Inverts the input value NOT TRUE = FALSE NOT FALSE = TRUE Highest precedence in Boolean expressions Executes before AND and OR operations |
Exclusive Disjunction (XOR)
Operation | Circuit symbol | Notes |
---|---|---|
A∨B A B
| Outputs TRUE if the inputs are different Outputs FALSE if they are the same |
Exam Tip
Understanding the order of operations is crucial for correctly interpreting complex Boolean expressions
Misunderstanding the order can lead to incorrect results
Always use parentheses for clarity when combining multiple Boolean operations
Truth Tables
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
Conjunction (AND)
Circuit symbol | Truth Table | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Disjunction (OR)
Circuit symbol | Truth Table | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Negation (NOT)
Circuit symbol | Truth Table | ||||||
---|---|---|---|---|---|---|---|
|
Exclusive Disjunction (XOR)
Circuit symbol | Truth Table | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Worked Example
Daniel is an engineer. He has created the following logic circuit as shown
Complete the truth table below for the logic circuit shown
A | B | C | D | X |
---|---|---|---|---|
0 | 0 | 0 |
|
|
0 | 0 | 1 |
|
|
0 | 1 | 0 |
|
|
0 | 1 | 1 |
|
|
1 | 0 | 0 |
|
|
1 | 0 | 1 |
|
|
1 | 1 | 0 |
|
|
1 | 1 | 1 |
|
|
4 marks
Answer:
Example answer that gets full marks:
A | B | C | Calculating D | D | Calculating X | X | Mark |
---|---|---|---|---|---|---|---|
0 | 0 | 0 | D is the result of | 0 | X is the result of | 0 | 1 Mark |
0 | 0 | 1 | 0 | 1 | |||
0 | 1 | 0 | 0 | 0 | 1 Mark | ||
0 | 1 | 1 | 0 | 1 | |||
1 | 0 | 0 | 0 | 0 | 1 Mark | ||
1 | 0 | 1 | 0 | 1 | |||
1 | 1 | 0 | 1 | 1 | 1 Mark | ||
1 | 1 | 1 | 1 | 0 |
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?