### Introduction to Logic Gates Logic gates are the basic building blocks of any digital system. They are electronic circuits having one or more inputs and only one output. The relationship between the input and the output is based on a certain logic. Based on this, logic gates are named as AND gate, OR gate, NOT gate, etc. ### AND Gate - **Symbol:** - **Formula (Boolean Expression):** $Y = A \cdot B$ or $Y = AB$ - **Truth Table:** | A | B | Y | |---|---|---| | 0 | 0 | 0 | | 0 | 1 | 0 | | 1 | 0 | 0 | | 1 | 1 | 1 | - **Description:** The output Y is 1 only when all inputs A and B are 1. Otherwise, the output is 0. ### OR Gate - **Symbol:** - **Formula (Boolean Expression):** $Y = A + B$ - **Truth Table:** | A | B | Y | |---|---|---| | 0 | 0 | 0 | | 0 | 1 | 1 | | 1 | 0 | 1 | | 1 | 1 | 1 | - **Description:** The output Y is 1 if any one or both inputs A and B are 1. The output is 0 only when both inputs are 0. ### NOT Gate (Inverter) - **Symbol:** - **Formula (Boolean Expression):** $Y = \bar{A}$ or $Y = A'$ - **Truth Table:** | A | Y | |---|---| | 0 | 1 | | 1 | 0 | - **Description:** The output Y is the complement of the input A. If A is 1, Y is 0, and if A is 0, Y is 1. ### NAND Gate - **Symbol:** - **Formula (Boolean Expression):** $Y = \overline{A \cdot B}$ or $Y = (AB)'$ - **Truth Table:** | A | B | Y | |---|---|---| | 0 | 0 | 1 | | 0 | 1 | 1 | | 1 | 0 | 1 | | 1 | 1 | 0 | - **Description:** The NAND gate is an AND gate followed by a NOT gate. Its output is 0 only when all inputs are 1. ### NOR Gate - **Symbol:** - **Formula (Boolean Expression):** $Y = \overline{A + B}$ or $Y = (A+B)'$ - **Truth Table:** | A | B | Y | |---|---|---| | 0 | 0 | 1 | | 0 | 1 | 0 | | 1 | 0 | 0 | | 1 | 1 | 0 | - **Description:** The NOR gate is an OR gate followed by a NOT gate. Its output is 1 only when all inputs are 0. ### XOR Gate (Exclusive OR) - **Symbol:** - **Formula (Boolean Expression):** $Y = A \oplus B = A\bar{B} + \bar{A}B$ - **Truth Table:** | A | B | Y | |---|---|---| | 0 | 0 | 0 | | 0 | 1 | 1 | | 1 | 0 | 1 | | 1 | 1 | 0 | - **Description:** The output Y is 1 if inputs A and B are different. The output is 0 if inputs are the same. ### XNOR Gate (Exclusive NOR) - **Symbol:** - **Formula (Boolean Expression):** $Y = \overline{A \oplus B} = AB + \bar{A}\bar{B}$ - **Truth Table:** | A | B | Y | |---|---|---| | 0 | 0 | 1 | | 0 | 1 | 0 | | 1 | 0 | 0 | | 1 | 1 | 1 | - **Description:** The output Y is 1 if inputs A and B are the same. The output is 0 if inputs are different. ### De Morgan's Theorems These theorems are fundamental for simplifying Boolean expressions: 1. **Theorem 1:** $\overline{A \cdot B} = \bar{A} + \bar{B}$ - The complement of a product is the sum of the complements. 2. **Theorem 2:** $\overline{A + B} = \bar{A} \cdot \bar{B}$ - The complement of a sum is the product of the complements.