Skip to content

Logic Gates

What are Logic Gates?

  • Definition: Logic gates are electronic circuits that perform logical operations on one or more binary inputs to produce a single binary output.
  • Binary Input/Output: Inputs and outputs are only 0 (LOW, FALSE) or 1 (HIGH, TRUE).
  • Use: Logic gates are the building blocks of digital computers, calculators, mobile phones, and microprocessors.

Types of Basic Logic Gates

There are three basic logic gates:

  1. AND Gate
  2. OR Gate
  3. NOT Gate

From these basic gates, we can form other complex gates.


1. AND Gate

  • Symbol:
    ➔ A flat-headed D-shaped symbol.
  • Function:
    • The AND gate gives output HIGH (1) only when all inputs are HIGH (1).
    • Otherwise, the output is LOW (0).
  • Truth Table:
Input AInput BOutput Y = A AND B
000
010
100
111
  • Boolean Expression: Y=A⋅BY = A \cdot BY=A⋅B
  • Behavior:
    • Think of it like pressing two switches together — light glows only when both switches are ON.

2. OR Gate

  • Symbol:
    ➔ A curved “greater-than” (>) shaped symbol.
  • Function:
    • The OR gate gives output HIGH (1) if any one or both inputs are HIGH (1).
  • Truth Table:
Input AInput BOutput Y = A OR B
000
011
101
111
  • Boolean Expression: Y=A+BY = A + BY=A+B
  • Behavior:
    • Similar to a condition: If either “A” or “B” is true, output is true.

3. NOT Gate

  • Symbol:
    ➔ A triangle pointing to a small circle.
  • Function:
    • The NOT gate is called an inverter. It inverts the input:
      • Input 0 → Output 1
      • Input 1 → Output 0
  • Truth Table:
Input AOutput Y = NOT A
01
10
  • Boolean Expression: Y=A‾Y = \overline{A}Y=A
  • Behavior:
    • It simply reverses the input value.

Derived Logic Gates

There are some special types of gates created by combining the basic ones.


4. NAND Gate (NOT + AND)

  • Symbol:
    ➔ AND gate symbol with a small bubble (circle) at the output.
  • Function:
    • The NAND gate gives the inverse output of an AND gate.
    • Output is LOW (0) only when both inputs are HIGH (1).
    • Otherwise, the output is HIGH (1).
  • Truth Table:
Input AInput BOutput Y = A NAND B
001
011
101
110
  • Boolean Expression: Y=A⋅B‾Y = \overline{A \cdot B}Y=A⋅B

5. NOR Gate (NOT + OR)

  • Symbol:
    ➔ OR gate symbol with a small bubble at the output.
  • Function:
    • The NOR gate gives the inverse output of an OR gate.
    • Output is HIGH (1) only when both inputs are LOW (0).
  • Truth Table:
Input AInput BOutput Y = A NOR B
001
010
100
110
  • Boolean Expression: Y=A+B‾Y = \overline{A + B}Y=A+B​

6. XOR Gate (Exclusive OR)

  • Symbol:
    ➔ OR symbol with an extra curved line before inputs.
  • Function:
    • The XOR gate gives HIGH (1) output when the inputs are different.
    • If inputs are the same, output is LOW (0).
  • Truth Table:
Input AInput BOutput Y = A XOR B
000
011
101
110
  • Boolean Expression: Y=(A⋅B‾)+(A‾⋅B)Y = (A \cdot \overline{B}) + (\overline{A} \cdot B)Y=(A⋅B)+(A⋅B)

7. XNOR Gate (Exclusive NOR)

  • Symbol:
    ➔ XOR gate symbol with a small circle at the output.
  • Function:
    • The XNOR gate gives HIGH (1) output when the inputs are the same.
  • Truth Table:
Input AInput BOutput Y = A XNOR B
001
010
100
111
  • Boolean Expression: Y=(A⋅B‾)+(A‾⋅B)‾Y = \overline{(A \cdot \overline{B}) + (\overline{A} \cdot B)}Y=(A⋅B)+(A⋅B)​

Universal Gates: NAND and NOR


What are Universal Gates?

  • Definition: Universal gates are gates using which any logical circuit can be built.
  • Which gates are Universal?
    • NAND Gate
    • NOR Gate

How is NAND Universal?

By combining NAND gates, we can create:

Desired GateCombination Using NAND
NOTConnect both inputs together (A NAND A)
ANDFirst NAND A and B, then NAND the result with itself
ORNAND the inversions of inputs, then NAND the results

✔ This proves NAND can perform NOT, AND, and OR operations = universal.


How is NOR Universal?

Similarly, using only NOR gates, we can build:

Desired GateCombination Using NOR
NOTConnect both inputs together (A NOR A)
ORFirst NOR A and B, then NOR the result with itself
ANDNOR the inversions of A and B

✔ So NOR can also create NOT, OR, and AND = universal.


Conclusion

  • Logic gates are crucial components in digital electronics.
  • NAND and NOR are very important because they can form any circuit by themselves.
  • Knowledge of truth tables, symbols, and Boolean expressions is essential for understanding computer hardware design and operations