GATE 2025 EC – Question 24
A full adder and an XOR gate are used to design a digital circuit with inputs $X$, $Y$, and $Z$, and output $F$, as shown below. The input $Z$ is connected to the carry-in input of the full adder.
If the input $Z$ is set to logic ‘1’, then the circuit functions as ________ with $X$ and $Y$ as inputs.

Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (B) a subtractor
Explanation
The XOR gate gives $Y\oplus Z$ to the second adder input. With $Z=1$ this is $\bar Y$, and the carry-in is also 1, so the adder computes $X+\bar Y+1$. That is the 2's complement subtraction $X-Y$, so the circuit is a subtractor.