Britannica Sources used in this answer

How do NAND, NOR, XOR, and XNOR gates differ from basic logic gates?

Created from Britannica articles using AI. AI can make mistakes, so verify using Britannica articles.

In logic design, the fundamental building blocks are the AND, OR, and NOT gates. These basic gates perform the primary operations of Boolean algebra, which serves as the foundation for all digital computer circuitry.1

NAND, NOR, XOR, and XNOR gates differ from these basic gates because they are composite circuits constructed by combining the primary AND, OR, and NOT gates. Their functional differences are as follows:1

  • NAND (NOT-AND): Produces an output of 1 if either input is 0, effectively inverting the result of an AND gate.1
  • NOR (NOT-OR): Produces an output of 1 only if both inputs are 0, inverting the result of an OR gate.1
  • XOR (Exclusive OR): Produces an output of 1 only if exactly one input is 1.1
  • XNOR (Exclusive NOR): Produces an output of 0 if only one input is 1, acting as the inverse of an XOR gate.1

By interconnecting these various gates, engineers can build complex devices capable of performing sophisticated arithmetic and logical operations.1