Logic gates are the building blocks of digital circuits. They perform basic logical functions that are fundamental to digital systems. The seven standard logic gates are as follows:
---
### **1. AND Gate**
- **Symbol**: A flat-topped "D"-shaped curve.
- **Function**: Outputs `1` (True) only if all its inputs are `1`. Otherwise, it outputs `0`.
- **Truth Table**:
| Input A | Input B | Output |
|---------|---------|--------|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
---
### **2. OR Gate**
- **Symbol**: A curved shape like a "pointed shield."
- **Function**: Outputs `1` if at least one input is `1`. Outputs `0` only if all inputs are `0`.
- **Truth Table**:
| Input A | Input B | Output |
|---------|---------|--------|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
---
### **3. NOT Gate (Inverter)**
- **Symbol**: A triangle pointing right with a small circle (inversion) at the output.
- **Function**: Produces the opposite of the input. If input is `1`, output is `0`; if input is `0`, output is `1`.
- **Truth Table**:
| Input | Output |
|-------|--------|
| 0 | 1 |
| 1 | 0 |
---
### **4. NAND Gate**
- **Symbol**: Similar to the AND gate but with a small circle (inversion) at the output.
- **Function**: Outputs the opposite of an AND gate. Outputs `0` if all inputs are `1`. Otherwise, outputs `1`.
- **Truth Table**:
| Input A | Input B | Output |
|---------|---------|--------|
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
---
### **5. NOR Gate**
- **Symbol**: Similar to the OR gate but with a small circle (inversion) at the output.
- **Function**: Outputs the opposite of an OR gate. Outputs `1` only if all inputs are `0`. Otherwise, outputs `0`.
- **Truth Table**:
| Input A | Input B | Output |
|---------|---------|--------|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 0 |
---
### **6. XOR Gate (Exclusive OR)**
- **Symbol**: Similar to the OR gate but with an additional curved line at the input.
- **Function**: Outputs `1` if the inputs are different (one `1` and one `0`). Outputs `0` if the inputs are the same.
- **Truth Table**:
| Input A | Input B | Output |
|---------|---------|--------|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
---
### **7. XNOR Gate (Exclusive NOR)**
- **Symbol**: Similar to the XOR gate but with a small circle (inversion) at the output.
- **Function**: Outputs the opposite of an XOR gate. Outputs `1` if the inputs are the same (both `0` or both `1`). Outputs `0` if the inputs are different.
- **Truth Table**:
| Input A | Input B | Output |
|---------|---------|--------|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
---
### Applications
- **Basic Digital Systems**: Used in arithmetic circuits, data storage, and control systems.
- **Advanced Electronics**: Form the basis for microprocessors, memory devices, and communication systems.
Understanding these gates is essential for designing and analyzing digital circuits.