Digital Electronics

All Logic Gates Explained: AND, OR, NOT, NAND, NOR, XOR, XNOR

🎥 Watch this quick video explanation of logic gates before reading the detailed guide below.

Prefer watching? Start with the video. Want full understanding? Read below 👇

Logic gates are the fundamental building blocks of digital electronics. Every complex digital system, including computers, calculators, and mobile phones, is constructed using these basic circuits. They work on binary input values—either 0 (Low) or 1 (High)—to perform logical operations and provide a specific binary output.

For students of electronics and computer science, mastering the symbols, truth tables, and Boolean expressions of these seven gates is essential. In this guide, we will analyze the AND, OR, NOT, NAND, NOR, XOR, and XNOR gates in detail to build a strong foundation in digital logic design.

“Digital logic is the language of modern machines. By understanding how 0s and 1s are processed through gates, we can understand how processors make complex decisions.”

1. The Basic Logic Gates

AND Gate

The AND gate performs logical multiplication. The output is 1 only when all inputs are 1. If any input is 0, the output is 0. Its Boolean expression is written as Y = A . B.

OR Gate

The OR gate performs logical addition. The output is 1 if at least one input is 1. The output is 0 only when both inputs are 0. Its Boolean expression is Y = A + B.

NOT Gate (The Inverter)

The NOT gate is a single-input gate that reverses the state of the input. If the input is 0, the output is 1, and vice versa. The Boolean expression is Y = Ā.

2. Comparison Table: Summary of Logic Gates

Gate Name Boolean Expression Logic Rule
ANDY = A . BOutput is 1 only if all inputs are 1.
ORY = A + BOutput is 1 if any input is 1.
NOTY = ĀOutput is opposite of input.
NANDY = (A . B)’Inverse of AND.
NORY = (A + B)’Inverse of OR.
XORY = A ⊕ BOutput is 1 if inputs differ.
XNORY = (A ⊕ B)’Output is 1 if inputs same.

3. The Universal Gates: NAND and NOR

NAND Gate

A combination of AND and NOT. Its output is 0 only when both A and B are 1.

NOR Gate

A combination of OR and NOT. Its output is 1 only when both inputs are 0.

4. The Exclusive Gates: XOR and XNOR

XOR Gate

The XOR gate outputs 1 only when inputs are different.

XNOR Gate

The XNOR gate outputs 1 only when inputs are identical.

Logic Gates FAQ for Students

What are Universal Gates?
NAND and NOR can implement any Boolean function.
Which gate is an inverter?
NOT gate acts as inverter.
When does XOR give 1?
When inputs are different.
Shubham Kola

Shubham Kola is a renowned educator in engineering education, recognized for his YouTube channel where he simplifies complex concepts for students worldwide.