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
  • Boolean algebra is easily confused with Boolean logic, but they are not the same
    • Boolean logic refers to the principles of logic based on binary values
    • Boolean algebra is a mathematical system used to manipulate Boolean values

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 brackets are evaluated first, following the same NOT, AND, OR precedence inside the brackets
  • 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)

OperationCircuit symbolNotes
and-gateReturns TRUE only if** both** inputs are TRUE 
TRUE AND TRUE = TRUE
Otherwise = FALSE
Next highest precedence after NOT
Executes before OR operations

Disjunction (OR)

OperationCircuit symbolExplanation
or-gateReturns 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)

SymbolCircuit symbolNotes
not-gateInverts the input value
NOT TRUE = FALSE
NOT FALSE = TRUE
Highest precedence in Boolean expressions
Executes before AND and OR operations

Exclusive Disjunction (XOR)

OperationCircuit symbolNotes

 
xor-gateOutputs TRUE if the inputs are different
Outputs FALSE if they are the same

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 SymbolAB
AND gate000
010
100
111

Disjunction (OR)

Circuit SymbolAB
OR gate000
011
101
111

Negation (NOT)

Circuit SymbolA
NOT gate01
10

Exclusive Disjunction (XOR)

Circuit SymbolAB
XOR gate000
011
101
110

Examiner Tips and Tricks

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

Worked Example

Daniel is an engineer. He has created the following logic circuit as shown

logic-circuit

Complete the truth table below for the logic circuit shown

ABCDX
000  
001  
010  
011  
100  
101  
110  
111  

[4 marks]

Example answer that gets full marks:

ABCCalculating DDCalculating XXMark
000D is the result of
A AND B
0X is the result of 
D XOR C
01 Mark
001D is the result of
A AND B
0X is the result of 
D XOR C
11 Mark
010D is the result of
A AND B
0X is the result of 
D XOR C
01 Mark
011D is the result of
A AND B
0X is the result of 
D XOR C
11 Mark
100D is the result of
A AND B
0X is the result of 
D XOR C
01 Mark
101D is the result of
A AND B
0X is the result of 
D XOR C
11 Mark
110D is the result of
A AND B
1X is the result of 
D XOR C
11 Mark
111D is the result of
A AND B
1X is the result of 
D XOR C
01 Mark