Consider the ALU shown below. If the operands are in 2's complement…

2003

Consider the ALU shown below.

GATECS2009Q46

If the operands are in 2's complement representation, which of the following operations can be performed by suitably setting the control lines K and C0 only (+ and - denote addition and subtraction respectively) ?

  1. A.

    A + B, and A - B, but not A + 1

  2. B.

    A + B, and A + 1, but not A - B

  3. C.

    A + B, but not A - B, or A + 1

  4. D.

    A + B, and A - B, and A + 1

Attempted by 56 students.

Show answer & explanation

Correct answer: A

The given ALU uses two full adders with control lines K and C0. The operations are analyzed as follows:

1. A + B: Set K = 0 and C0 = 0. This directly adds A and B.

2. A - B: Set K = 1 and C0 = 0. This computes A + B' + 1, which is A - B in 2's complement.

3. A + 1: Set K = 0 and C0 = 1. This adds A and 1 directly.

All three operations can be performed by setting K and C0 appropriately. Therefore, the correct option is D.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Gate Guidance By Sanchit Sir