A **2-to-4 decoder** is a digital circuit that takes in **2 input bits** and decodes them into **4 distinct output lines**. It is a common component in digital electronics, used to select one of several output lines based on the binary value of the input.
### How it Works:
- **Inputs**: 2 bits (letβs call them \( A \) and \( B \)).
- **Outputs**: 4 lines (letβs call them \( O_0 \), \( O_1 \), \( O_2 \), and \( O_3 \)).
Each output corresponds to a specific combination of input bits, and only one of the outputs will be active (HIGH) at any time, based on the binary combination of the input bits. The others will remain inactive (LOW).
### Truth Table:
| \( A \) | \( B \) | \( O_0 \) | \( O_1 \) | \( O_2 \) | \( O_3 \) |
|:------:|:------:|:--------:|:--------:|:--------:|:--------:|
| 0 | 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 | 0 | 0 |
| 1 | 0 | 0 | 0 | 1 | 0 |
| 1 | 1 | 0 | 0 | 0 | 1 |
### Explanation:
- The decoder takes 2 input bits (\( A \) and \( B \)) and activates one of the 4 outputs depending on the combination of those inputs.
- When **\( A = 0 \) and \( B = 0 \)**, output \( O_0 \) is HIGH (1), and the rest are LOW (0).
- When **\( A = 0 \) and \( B = 1 \)**, output \( O_1 \) is HIGH.
- When **\( A = 1 \) and \( B = 0 \)**, output \( O_2 \) is HIGH.
- When **\( A = 1 \) and \( B = 1 \)**, output \( O_3 \) is HIGH.
### Use Cases:
- **Multiplexing**: Select which of many inputs should be connected to the output.
- **Memory Address Decoding**: In computers, to select specific memory locations based on address bits.
- **Control Systems**: To control different operations or enable different devices based on input conditions.
A 2-to-4 decoder essentially works by interpreting the input combination and activating only one output line corresponding to that combination.