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:
- AND Gate
- OR Gate
- 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 A | Input B | Output Y = A AND B |
---|
0 | 0 | 0 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |
- 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 A | Input B | Output Y = A OR B |
---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 1 |
- 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 A | Output Y = NOT A |
---|
0 | 1 |
1 | 0 |
- 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 A | Input B | Output Y = A NAND B |
---|
0 | 0 | 1 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
- 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 A | Input B | Output Y = A NOR B |
---|
0 | 0 | 1 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 0 |
- 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 A | Input B | Output Y = A XOR B |
---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
- 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 A | Input B | Output Y = A XNOR B |
---|
0 | 0 | 1 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |
- 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?
How is NAND Universal?
By combining NAND gates, we can create:
Desired Gate | Combination Using NAND |
---|
NOT | Connect both inputs together (A NAND A) |
AND | First NAND A and B, then NAND the result with itself |
OR | NAND 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 Gate | Combination Using NOR |
---|
NOT | Connect both inputs together (A NOR A) |
OR | First NOR A and B, then NOR the result with itself |
AND | NOR 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