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
NAND, NOR and XOR Gates and Truth Tables
  1. 1The NAND and NOR gates
  2. 2The XOR gate
  3. 3Completing truth tables
  1. Computer Science
  2. /NAND, NOR and XOR Gates and Truth Tables
  3. /The NAND and NOR gates

Course 10.2·Lesson 1 of 3

The NAND and NOR gates

NAND means NOT AND, and NOR means NOT OR. Each is one gate with a small circle at its output. You learn both symbols and truth tables, and why the output column of NAND is the AND column turned upside down in every row.

about 25 min1 simulation1 practice question
Lesson 1 of 3Show all lessonsHide
NAND, NOR and XOR Gates and Truth Tables
  1. 1The NAND and NOR gates
  2. 2The XOR gate
  3. 3Completing truth tables

Try the code and the simulations beside the lesson.

The small circle again

In the last course you met the small circle at the output of the NOT gate. It means "take the opposite". Put that circle on an AND gate and you get NAND. Put it on an OR gate and you get NOR.

The NAND gate

NAND is short for NOT AND. It gives the opposite of an AND gate. So it gives 0 only when both inputs are 1, and 1 in every other row.

On the left, a NAND gate symbol: the AND shape with a small circle at the output, inputs A and B, output X. The words 'is the same as' follow. On the right, an AND gate with inputs A and B whose output goes into a NOT gate, whose output is X.

The picture shows that one NAND gate does the same job as an AND gate followed by a NOT gate. In the examination, though, draw the NAND symbol when a question asks for a NAND gate.

A BA AND BX = A NAND B
0 001
0 101
1 001
1 110

The logic expression is X = A NAND B. You may also see it written as X = NOT (A AND B).

An example. A machine has a warning light that stays on until both safety checks pass. Check 1 gives C = 1 when it passes, and check 2 gives D = 1. The light is W = C NAND D. It goes off only when both checks pass.

The NOR gate

NOR is short for NOT OR. It gives the opposite of an OR gate. So it gives 1 only when both inputs are 0.

A BA OR BX = A NOR B
0 001
0 110
1 010
1 110

The logic expression is X = A NOR B, or X = NOT (A OR B).

An example. A "ready" lamp on a printer is on only when there is no fault. One sensor gives J = 1 for a paper jam, and another gives E = 1 when the ink is empty. The lamp is R = J NOR E. Any fault turns it off.

A quick way to remember

  • NAND is the AND column with every value turned over: 0, 0, 0, 1 becomes 1, 1, 1, 0.
  • NOR is the OR column with every value turned over: 0, 1, 1, 1 becomes 1, 0, 0, 0.
  • NAND has one 0, in the row 1 1. NOR has one 1, in the row 0 0.

Practise with new numbers

Try it in Python

The program builds NAND and NOR from the gates you already know. It prints both columns. It also joins the two inputs of a NAND gate together, which makes it act like a NOT gate.

Read it first. Then run it. Which gate has only one 1 in its column?

1. Print [NOR(a, a) for a in (0, 1)]. Does a NOR gate with joined inputs also act like NOT?

2. Add a function AND2(a, b) that uses only NAND. Hint: put a NAND gate after a NAND gate.

Common mistakes

  • Treating NAND as "AND, but only sometimes". NAND is exactly the opposite of AND in every row.
  • Leaving out the small circle. Without it, a NAND gate becomes an AND gate in the marker's eyes.
  • Mixing up NOR and XOR. NOR has a small circle at the output. XOR has an extra curved line at the back.

Remember these

  • NAND = NOT AND: output column 1, 1, 1, 0.
  • NOR = NOT OR: output column 1, 0, 0, 0.
  • Both symbols are the AND or OR shape with a small circle at the output.

Check yourself

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

  1. A NAND gate has A = 1 and B = 0. What is the output?
  1. A NOR gate gives 1. What are its inputs?
  1. Which symbol has a flat back, a round front and a small circle at the output?
  1. Write X = NOT (A OR B) as one gate.
  1. In how many rows of its truth table does a NAND gate give 1?

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 NAND, NOR and XOR Gates and Truth Tables

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 cutting machine has a warning light W…Easy · High School (9–10) · by StemPy Lab
A printer has a "ready" lamp R. A jam sensor gives J = 1 when paper is stuck, and an ink sensor…Medium · High School (9–10) · by StemPy Lab
A student has only NAND gates. She joins the two inputs of one NAND gate together and feeds the…Medium · High School (9–10) · by StemPy Lab
Next: lesson 2The XOR gate
← NAND, NOR and XOR Gates and Truth Tables
← PreviousThe XOR gate →

Discussion (0)

Log in to join the discussion.

Loading…

1 Python program
5 questions to check yourself

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

Python Labs (1)

NAND, NOR and XOR from three gatesPython Lab · by StemPy Lab