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 passes $Y$ unchanged when $Z=0$ and complements it when $Z=1$. With $Z=1$ it produces $\bar Y$, and $Z$ is also the carry-in, so the adder computes
$X+\bar Y+1$.
That is the 2's complement subtraction $X-Y$, so the circuit is a subtractor.