Step 1: Understanding XOR gate.
The XOR (exclusive OR) gate is a digital logic gate that outputs true (1) if and only if the inputs are different. If both inputs are the same, the output is false (0).
Step 2: Explanation of each option.
- (A) OR gate: Incorrect. The OR gate outputs true if at least one of the inputs is true, regardless of whether they are the same or different.
- (B) AND gate: Incorrect. The AND gate outputs true only if both inputs are true.
- (C) NOT gate: Incorrect. The NOT gate inverts the input but does not depend on whether the inputs are the same or different.
- (D) XOR gate: Correct. The XOR gate outputs true only if the inputs are different.
Step 3: Conclusion.
The correct gate whose output is true only if the inputs are different is the XOR gate.