Consider a digital design where a Full Adder circuit is configured using…
Consider a digital design where a Full Adder circuit is configured using an external control input Z . The inputs to the full adder are X , Y , and the carry-in input C_{in} is tied directly to the logic value of Z . When Z = 1 , the input Y is bitwise XORed with Z before reaching the adder logic. Which mathematical operation does this circuit perform on the inputs X and Y when the control input Z is actively set to 1?
- $X + Y$ (Addition)
- $X - Y$ (Subtraction)
- $X \cdot Y$ (Bitwise AND)
- $X \oplus Y$ (Ex-OR only)
Correct answer
B. $X - Y$ (Subtraction)
Explanation
(B) $X - Y$ (Subtraction) When $Z = 1$, the carry-in ($C_{in}$) to the full adder becomes $1$. Simultaneously, the input $Y$ passes through an Ex-OR gate with $Z$, resulting in: Y \oplus Z = Y \oplus 1 = \bar{Y} The full adder computes the sum as $X + \bar{Y} + C_{in}$. Replacing $C_{in}$ with 1 yields: Output = X + \bar{Y} + 1 In 2's complement arithmetic, the expression $\bar{Y} + 1$ represents $-Y$. Therefore, the overall system functions exactly like a binary subtractor computing $X - Y$.