HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
NOT, AND and OR Gates
  1. 1Logic gates and the NOT gate
  2. 2The AND gate
  3. 3The OR gate and joining two gates
  1. Computer Science
  2. /NOT, AND and OR Gates
  3. /Logic gates and the NOT gate

Course 10.1·Lesson 1 of 3

Logic gates and the NOT gate

A logic gate takes inputs that are 0 or 1 and gives one output that is 0 or 1. This lesson shows the six gate symbols you must draw in the examination, explains a truth table, and starts with the simplest gate, NOT, which gives the opposite of its one input.

about 25 min1 simulation1 practice question1 Python program5 questions to check yourself

This lesson is free to read. Enroll free to keep your place and take the tests.

Lesson 1 of 3Show all lessonsHide
NOT, AND and OR Gates
  1. 1Logic gates and the NOT gate
  2. 2The AND gate
  3. 3The OR gate and joining two gates

Try the code and the simulations beside the lesson.

Yes or no, 1 or 0

Think of a light switch. It is either on or off. There is no half way. A door is open or shut. A button is pressed or not pressed.

A computer works with values like these. It stores and handles everything as binary, as 0 and 1. Inside the processor, the 0s and 1s are handled by tiny electronic parts called logic gates.

  • A logic gate has one or two inputs and one output.
  • Each input is 0 or 1. The output is 0 or 1.
  • The gate follows a fixed rule. The same inputs always give the same output.

We read 1 as on or true, and 0 as off or false. This kind of logic, with only two values, is called Boolean logic.

The six gates and their symbols

The syllabus names six gates: NOT, AND, OR, NAND, NOR and XOR. XOR is also written EOR. In the examination you draw circuits with these exact symbols, so learn their shapes now.

The six logic gate symbols of the syllabus in two columns, each with its name. NOT: a triangle pointing right with a small circle at its point, one input. AND: a flat back and a round front, two inputs. OR: a curved back and a pointed front, two inputs. NAND: the AND shape with a small circle at the output. NOR: the OR shape with a small circle at the output. XOR (EOR): the OR shape with a second curved line behind its back.

Look at the shapes.

  • NOT is a triangle with a small circle at its point. It has one input.
  • AND has a flat back and a round front.
  • OR has a curved back and a pointed front.
  • NAND and NOR are the AND and OR shapes with the small circle at the output.
  • XOR is the OR shape with a second curved line behind its back.

NOT is the only gate with one input. Every other gate in this syllabus has exactly two inputs. The small circle always means "then take the opposite". You will meet it again in the next course.

The truth table

How do we show what a gate does? We list every possible input and the output for each one. This list is a truth table.

A gate with one input has two rows, because the input can be 0 or 1. A gate with two inputs has four rows. With three inputs there are eight rows.

The NOT gate

The NOT gate gives the opposite of its input. A 1 goes in and a 0 comes out. A 0 goes in and a 1 comes out.

AX = NOT A
01
10

We write this as the logic expression X = NOT A. Read it as "X equals not A".

An example. A night light has a light sensor. The sensor gives 1 when it is light outside. We want the lamp on when it is not light. So the lamp is X = NOT L, where L is the sensor. In the day, L = 1 and the lamp is off. At night, L = 0 and the lamp is on.

Practise with new numbers

Try it in Python

The program writes the NOT gate as a small function. It prints both rows of the truth table, then works out the night light. Here 1 - a turns 1 into 0 and 0 into 1.

Read it first. Then run it. Do the two rows match the truth table above?

1. Change light = 1 to light = 0. Predict the lamp before you run it.

2. Add a line that prints NOT(NOT(1)). What do you expect?

You met not in Python in the course And, Or, Not: Combining Conditions of the Python Foundations book. A logic gate does the same job with 0 and 1 instead of True and False.

Common mistakes

  • Drawing NOT without its small circle. A triangle alone is a different symbol. The small circle is part of the NOT gate.
  • Giving NOT two inputs. NOT always has exactly one input.
  • Mixing up the input and the output. The input goes into the flat side of the triangle. The output leaves from the small circle.

Remember these

  • A logic gate has inputs and one output. Each is 0 or 1.
  • A truth table lists every input and its output. One input gives 2 rows, two inputs give 4 rows.
  • NOT gives the opposite of its input: X = NOT A.
  • Learn the six symbols exactly. NOT has one input, the others have two.

Check yourself

Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.

  1. A NOT gate has the input 1. What is its output?
  1. How many inputs does a NOT gate have, and how many does an AND gate have?
  1. Which part of a gate symbol tells you that the output is turned the other way?
  1. A truth table has inputs A and B. How many rows does it have?
  1. A fan should run when the room is not cold. The sensor C gives 1 when the room is cold. Write the logic expression for the fan F.

References

  • Cambridge International, IGCSE Computer Science 0478 syllabus for 2026, 2027 and 2028, topic 10 Boolean logic, and section 4, Logic gate symbols.

Enroll free in NOT, AND and OR Gates

Every lesson is open to read. Enrolling also lets you:

  • Mark lessons done and carry on where you stopped.
  • Take the tests of this lesson and its course.
  • Count the course towards the certificate for its chapter.
No payment. You can leave at any time.

Problems (3)

A street lamp is controlled by a light sensor L through a NOT gate…Easy · High School (9–10) · by StemPy Lab
A student has to learn the six logic gate symbols of the syllabus: NOT, AND, OR, NAND, NOR and XOR…Easy · High School (9–10) · by StemPy Lab
Three NOT gates are joined in a chain. The input A goes into the first gate, its output goes into…Medium · High School (9–10) · by StemPy Lab
Next: lesson 2The AND gate
← NOT, AND and OR Gates
← PreviousThe AND gate →

Discussion (0)

Log in to join the discussion.

Loading…