Logic Gates (Cambridge (CIE) A Level Computer Science) : Revision Note

Robert Hampton

Written by: Robert Hampton

Reviewed by: James Woodhouse

Updated on

Logic gates

What is a logic gate?

  • A logic gate is a visual way of representing a Boolean expression

  • The logic gates covered in this course are:

    • AND

    • OR

    • NOT

    • XOR

    • NAND

    • NOR

AND

Expression operator

Circuit symbol

Function

(A AND B)

and-gate

Returns TRUE only if both inputs are TRUE 

TRUE AND TRUE = TRUE

Otherwise = FALSE

OR

Expression operator

Circuit symbol

Function

(A OR B)

or-gate

Returns TRUE if either input is TRUE 

TRUE OR FALSE = TRUE 

FALSE OR FALSE = FALSE

NOT

Expression operator

Circuit symbol

Function

(NOT A)

not-gate

Reverses the input value

NOT TRUE = FALSE

NOT FALSE = TRUE

XOR (exclusive OR)

Expression operator

Circuit symbol

Function

(A XOR B)

xor

Returns TRUE if either input is TRUE but NOT both

TRUE OR FALSE = TRUE 

FALSE OR FALSE = FALSE

TRUE OR TRUE = FALSE

NAND (not and)

Expression operator

Circuit symbol

Function

(A NAND B)

screenshot-2023-05-30-at-08-25-01

Returns TRUE if either or both inputs are FALSE

TRUE OR FALSE = TRUE

FALSE OR FALSE = TRUE

TRUE OR TRUE = FALSE

NOR (not OR)

Expression operator

Circuit symbol

Function

(A NOR B)

screenshot-2023-05-30-at-08-25-22

Returns TRUE if both inputs are FALSE

TRUE OR FALSE = FALSE

FALSE OR FALSE = TRUE

TRUE OR TRUE = FALSE

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

AND 

Circuit symbol

Truth Table

screenshot-2023-05-30-at-08-24-36

A

B

A AND B

0

0

0

0

1

0

1

0

0

1

1

1

OR

Circuit symbol

Truth Table

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

A

B

A OR B

0

0

0

0

1

1

1

0

1

1

1

1

NOT

Circuit symbol

Truth Table

screenshot-2023-05-30-at-08-24-28

A

NOT

0

1

1

0

XOR (exclusive)

Circuit symbol

Truth Table

screenshot-2023-05-30-at-08-25-28

A

B

A XOR B

0

0

0

0

1

1

1

0

1

1

1

0

NAND (not and)

Circuit symbol

Truth Table

screenshot-2023-05-30-at-08-25-01

A

B

NOT (A AND B)

0

0

1

0

1

1

1

0

1

1

1

0

NOR (not or)

Circuit symbol

Truth Table

Logic gate diagram showing a NOR gate with two input lines on the left and one output line on the right with a small circle.

A

B

NOT (A OR B)

0

0

1

0

1

0

1

0

0

1

1

0

You've read 0 of your 5 free revision notes this week

Unlock more, it's free!

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

Expertise: Computer Science Content Creator

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.

James Woodhouse

Reviewer: James Woodhouse

Expertise: Computer Science Lead

James graduated from the University of Sunderland with a degree in ICT and Computing education. He has over 14 years of experience both teaching and leading in Computer Science, specialising in teaching GCSE and A-level. James has held various leadership roles, including Head of Computer Science and coordinator positions for Key Stage 3 and Key Stage 4. James has a keen interest in networking security and technologies aimed at preventing security breaches.