Truth Tables (CIE IGCSE Computer Science)

Revision Note

Test Yourself
Becci Peters

Expertise

Computer Science

Truth Tables

NOT gate

  • A NOT gate has one input and will invert it to produce an opposite output. This is shown in the truth table below
  • A is the input
  • Z is the output

not


Input


Output

A

Z

0

1

1

0

AND gate

  • An AND gate has two inputs

and


Input


Output

A

B

Z

0

0

0

0

1

0

1

0

0

1

1

1

  • The AND gate truth table shows the only combination of inputs which will result in a positive output is 1 and 1

OR gate

  • An OR gate has two inputs  

or


Input


Output

A

B

Z

0

0

0

0

1

1

1

0

1

1

1

1

  • The truth table shows an OR gate produces an output of 1 if any of the inputs are a 1

NOR gate

  • A NOR gate has two inputs

nor


Input


Output

A

B

Z

0

0

1

0

1

0

1

0

0

1

1

0

  • The truth table shows a NOR gate works oppositely to an OR gate - the only input combination which results in a 1 is two 0s

NAND gate

  • A NAND gate has two inputs  

nand


Input


Output

A

B

Z

0

0

1

0

1

1

1

0

1

1

1

0

  • The truth table shows a NAND gate works in the opposite way to an AND gate - the only input combination which does not result in a 1 is two positive inputs (1 +1)

XOR gate

  • An XOR gate has two inputs 

xor


Input


Output

A

B

Z

0

0

0

0

1

1

1

0

1

1

1

0

  • The truth table shows how an XOR gate works. It will only output a 1 if the two inputs are different to one another

Worked example

A truth table for a two input (A and B) logic gate

A

B

X

0

0

0

0

1

1

1

0

1

1

1

1

Identify what logic gate the truth table is representing

[1]

OR [1]

What symbol is used to represent this logic gate?

[1]

or

[1]

  • Truth tables can also be used to help work out the possible outputs of a logic circuit containing more than one gate

Exam Tip

  • You will only be asked to create truth tables for logic circuits with three inputs. The number of rows you should have in a three input truth table is 8 (not including the headings)
  • When creating a truth table for multiple inputs, begin by entering the possible input combinations into the leftmost columns

A truth table for a three input (A, B and C) logic gate

A

B

C

 

Z

0

0

0

   

0

0

1

   

0

1

0

   

0

1

1

   

1

0

0

   

1

0

1

   

1

1

0

   

1

1

1

   

  • The column on the right contains the final output of the logic circuit (Z)
  • Column(s) in between the inputs and the final output can be used to help work out the final output by containing intermediary outputs
  • Intermediary outputs are the output of gates found within the logic circuit
  • In the logic circuit diagram below, D and E are intermediary outputs

screenshot-2023-05-30-at-08-49-04

  • The fourth column labelled D represents the output of NOT A

A

B

C

D (NOT A)

E

Z

0

0

0

1

   

0

0

1

1

   

0

1

0

1

   

0

1

1

1

   

1

0

0

0

   

1

0

1

0

   

1

1

0

0

   

1

1

1

0

   

  • The next intermediary output is E which is the equivalent of ((NOT A) AND B) this notation is called a logic expression
  • The E intermediary output can be worked out by performing the AND logical operation on columns B and D


A


B


C


D (NOT A)


E ((NOT A) AND B)


Z

0

0

0

1

0

 

0

0

1

1

0

 

0

1

0

1

1

 

0

1

1

1

1

 

1

0

0

0

0

 

1

0

1

0

0

 

1

1

0

0

0

 

1

1

1

0

0

 

  • The final output (Z) can be worked out by performing the OR logical operation on columns E and C


A


B


C


D (NOT A)


E ((NOT A) AND B)


Z (((NOT A) AND B) OR C)

0

0

0

1

0

0

0

0

1

1

0

1

0

1

0

1

1

1

0

1

1

1

1

1

1

0

0

0

0

0

1

0

1

0

0

1

1

1

0

0

0

0

1

1

1

0

0

1

Exam Tip

  • In the exam it is likely truth tables will just contain columns for the inputs and the final output. You can still work out intermediary outputs to help you find the final output answers

Worked example

screenshot-2023-05-30-at-08-52-53

Complete the Truth table for the logic circuit above

A

B

Q

0

0

 

0

1

 

1

0

 

1

1

 

[4]

A

B

Q

0

0

1

0

1

1

1

0

0

1

1

1

[4]

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?

Becci Peters

Author: Becci Peters

Becci has been a passionate Computing teacher for over 9 years, teaching Computing across the UK helping to engage, interest and develop confidence in the subject at all levels. Working as a Head of Department and then as an educational consultant, Becci has advised schools in England, where her role was to support and coach teachers to improve Computing teaching for all. Becci is also a senior examiner for multiple exam boards covering GCSE & A-level. She has worked as a lecturer at a university, lecturing trainee teachers for Computing.