*Question E7A07:
What logical operation does a NAND gate perform?*  

*Correct Answer is  D: It produces a 0 at its output only if all inputs are 1*  

### AI Response: (may contain errors)  

A NAND gate is a fundamental building block in digital electronics. It performs a specific logical operation on its inputs and produces an output based on that operation.

### Explanation:

1. **Correct Answer: D**  
   A NAND gate produces a 0 at its output only if all inputs are 1. This is because a NAND gate is the inverse of an AND gate. An AND gate outputs 1 only when all its inputs are 1. Therefore, a NAND gate, being the opposite, will output 0 only when all inputs are 1.

2. **Why Other Choices Are Incorrect:**
   - **Choice A:** "It produces a 0 at its output only if all inputs are 0" is incorrect. A NAND gate will output 1 if any input is 0.
   - **Choice B:** "It produces a 1 at its output only if all inputs are 1" is incorrect. This describes an AND gate, not a NAND gate.
   - **Choice C:** "It produces a 0 at its output if some but not all inputs are 1" is incorrect. A NAND gate will still output 1 if some inputs are 1 and others are 0.

### Useful Rule:

- **NAND Gate Truth Table:**

  | Input A | Input B | Output (NAND) |
  |---------|---------|---------------|
  | 0       | 0       | 1             |
  | 0       | 1       | 1             |
  | 1       | 0       | 1             |
  | 1       | 1       | 0             |

This truth table shows that the output is 0 only when both inputs are 1, confirming the correct answer.