IAE Academy

GATE 2025 EC Q.24: solution and answer

GATE 2025 · ECQ.24 · 1 mark · MCQ

A full adder and an XOR gate are used to design a digital circuit with inputs , , and , and output , as shown below. The input is connected to the carry-in input of the full adder.

If the input is set to logic '1', then the circuit functions as ________ with and as inputs.

GATE 2025 EC question 24: Three inputs X, Y, Z enter from the top.Tap to open full size
Figure from the GATE 2025 EC paper. It is part of the question.
Figure description

Three inputs X, Y, Z enter from the top. X goes straight down into the left operand input of a block labelled "full adder" (drawn as a trapezoid, wide edge on top). Y and Z are the two inputs of a 2-input XOR gate; the XOR output goes into the right operand input of the full adder. Z also branches off at a junction dot above the XOR gate and runs round the right side into the full adder's side input, which is its carry-in. The full adder's output is a 2-bit bus (a slash marked 2), labelled F, which carries the sum and the carry-out.

  1. (A)

    an adder

  2. (B)

    a subtractor

  3. (C)

    a multiplier

  4. (D)

    a binary to Gray code converter

Answer and solution

ANSWER

With the XOR gate feeds into the full adder and the carry-in is 1. The adder therefore computes , so the circuit works as a subtractor. The answer is (B).

Official answer: BSource: Official answer key, GATE 2025 EC (IIT Roorkee)

  1. Read the circuit: the full adder's operands are and , and its carry-in is .

  2. XOR acts as a controlled inverter: (an overline means complement). So with we get and .

  3. The full adder now computes . Since is the 2's complement of , this is , which is subtraction by 2's complement.

  4. Check the sum bit: . This is exactly the difference bit of a subtractor.

  5. Check the carry bit using : . Its complement is , which is the borrow of .

  6. Truth table for : , , , . So , and the borrow is 1 only for . That is the subtractor's truth table.

  7. (When , and , so the same circuit is an adder. is the add/subtract control.) With the circuit is a subtractor, so the answer is (B).

KEY IDEA

An XOR gate with one input tied to a control line passes through when and inverts it when . If the same also drives the carry-in, the full adder computes for and (2's complement) for . This is the standard adder-subtractor, and the difference bit is while the borrow is .

WATCH OUT FOR

Answering "an adder" because the block is labelled full adder, without noticing that the XOR gate complements when and that also supplies the carry-in of 1. A second slip is reading itself as the borrow. In 2's-complement subtraction the borrow is the complement of the carry-out: here , and borrow .

From the GATE 2025 EC paper. Every question of this paper · Download the full paper · All 12 Combinational questions, with notes

More Combinational questions