By including which logical gate, binary adder circuit is used for both binary…

2021

By including which logical gate, binary adder circuit is used for both binary addition and subtraction?

  1. A.

    Ex-AND gate

  2. B.

    AND gate

  3. C.

    Ex-OR gate

  4. D.

    OR gate

Attempted by 2094 students.

Show answer & explanation

Correct answer: C

An adder-subtractor circuit reuses a single binary adder for both operations by placing a controlled inverter between the second operand and the adder's inputs. A controlled inverter is built from Ex-OR (XOR) gates because XOR with one input tied to a control line C reproduces B unchanged when C = 0 (B XOR 0 = B) and reproduces the complement of B when C = 1 (B XOR 1 = B').

Applying this to the circuit: each bit of operand B is passed through an Ex-OR gate whose second input is a mode-control line M, and M also feeds the adder's carry-in.

  1. M = 0: every Ex-OR gate outputs B unchanged, so the circuit computes A + B (binary addition).

  2. M = 1: every Ex-OR gate outputs B' (the one's complement of B) and the carry-in becomes 1, so the circuit computes A + B' + 1, which equals A plus the two's complement of B, i.e. A - B (binary subtraction).

By including the Ex-OR gate ahead of the adder's inputs, one control line M therefore switches the same adder between addition and subtraction.

Checking this against the other gate types confirms none of them provides the required pass-at-0/complement-at-1 behaviour under the standard shared mode-line convention:

  • AND gate (Y = A.B): ANDing an operand with a control bit of 0 always forces the output to 0, so it can never reproduce the operand unchanged - it cannot act as a pass-or-complement switch.

  • OR gate (Y = A + B): ORing an operand with a control bit of 1 always forces the output to 1, so it too cannot reproduce the operand unchanged for one control value and its complement for the other.

  • Ex-AND gate (Y = A.B + A'.B'): this gate also switches between pass-through and complement across its two control states, but with the opposite polarity to what the circuit needs - it outputs B' when the control is 0 and B when the control is 1 - so under the standard single mode-line M convention (where M = 1 must both complement B and set carry-in to 1 for subtraction) it cannot serve as the required pass-at-0/complement-at-1 switch without redesigning the control-line convention.

Only the Ex-OR gate's truth table (output = B when the control is 0, output = B' when the control is 1) meets the controlled-inversion requirement, which is why including an Ex-OR gate lets a binary adder circuit perform both addition and subtraction.

Explore the full course: Up Lt Grade Assistant Teacher 2025

Loading lesson…