GATE 2014 EC (EC2) – Question 26
A half-subtractor has inputs X,Y and difference N = X − Y. Find borrow M and difference N.
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (C) $M=\overline XY,\ N=X\oplus Y$
Explanation
Subtracting Y from X produces a borrow only for X=0,Y=1, so M=X̄Y. The one-bit difference is1whenever the inputs differ, giving N=X XOR Y. Thus **M=X̄Y,N=X XOR Y,C**. The borrow direction follows the specified subtraction X−Y.