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.
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 |
|---|---|---|
| AND | Y = A . B | Output is 1 only if all inputs are 1. |
| OR | Y = A + B | Output is 1 if any input is 1. |
| NOT | Y = Ā | Output is opposite of input. |
| NAND | Y = (A . B)’ | Inverse of AND. |
| NOR | Y = (A + B)’ | Inverse of OR. |
| XOR | Y = A ⊕ B | Output is 1 if inputs differ. |
| XNOR | Y = (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.