Combining Boolean Operators (OCR GCSE Computer Science)

Revision Note

Flashcards
Robert Hampton

Expertise

Computer Science Content Creator

Combining Boolean Operators

  • Boolean operators can be combined to produce more complex expressions
  • The combination of two or more Boolean operators forms a logic expression
  • Brackets are used to clarify the order of operations
  • A logic diagram is a visual representation of combinations of Boolean operators within a logic circuit
  • An example would be Q = NOT(A OR B)

logic circuit1

  • In the 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
  • This is a logic diagram for the Boolean expression Q = NOT(A OR B)

Exam Tip

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

Logic circuits will be limited to a maximum of three inputs and one output

Example of combining Boolean operators

10-boolean-logic

  • P = (A OR B) AND NOT C

Apply Logical Operators in 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
  • 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
1 1 1

    • 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

    • The last column shows the result of the Boolean expression by comparing (A AND B) AND NOT C
A B C A AND B NOT C (A AND B) AND NOT C
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

Exam Tip

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.

Worked example

Complete the truth table for the following logic diagram [4]

logic circuit3

A B Q
0 0 0
0 1 1
  0  
1    

Answers

A B Q
0 0 0
0 1 1
1 0 0
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)

Join the 100,000+ Students that ❤️ Save My Exams

the (exam) results speak for themselves:

Did this page help you?

Robert Hampton

Author: Robert Hampton

Rob has over 16 years' experience teaching Computer Science and ICT at KS3 & GCSE levels. Rob has demonstrated strong leadership as Head of Department since 2012 and previously supported teacher development as a Specialist Leader of Education, empowering departments to excel in Computer Science. Beyond his tech expertise, Robert embraces the virtual world as an avid gamer, conquering digital battlefields when he's not coding.