edited by
16,605 views
53 votes
53 votes

Consider the ALU shown below.

 

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 $C_0$ only (+ and – denote addition and subtraction respectively)?

  1. $A + B$, and $A – B$, but not $A + 1$
  2. $A + B$, and $A + 1$, but not $A – B$
  3. $A + B$, but not $A – B$ or $A + 1$
  4. $A + B$, and $A – B$, and $A + 1$
edited by

5 Answers

Best answer
51 votes
51 votes

Correct Option: A

There are two  control line one is $K$ and another is $C_{0}$ .

  • When $K=1$ , $C_{0}= 1$ we can perform $A-B$
  • When $K=0$,  $C_{0}=0$ we can perform $A+B$

But without manipulating $B(B_{0},B_{1},\ldots)$ we cannot perform A+1. But here we have only two control lines which is $K,C_{0}$. Therefore the answer is A.

Note: 

For A+B : $C_{0}= 0$ , $K=0$, and $0 \oplus x = x$


$\frac{\begin{matrix} &A3 &A2 &A1 &A0 \\ +& B3 & B2 & B1 & B0 \end{matrix}}{\begin{matrix} &S3&S2&S1&S0\end{matrix}}$

$\frac{\begin{matrix} &C3&C2&C1&C0=0\\ &A3 &A2 &A1 &A0 \\ \qquad\qquad\qquad\qquad+& B3 & B2 & B1 &B0 \end{matrix}}{\begin{matrix} Sum \enspace Output:&S3&S2&S1&S0\\Carry \enspace Output:\qquad&C4&C3&C2&C1\end{matrix}}$

 

For A-B : $C_{0} = 1$ , $K = 1$, and $1\oplus x=\bar x$

given that numbers are in 2's complement representations, So A - B = A + 2's complement of B

How to get 2's complement of B ? 

2's complement of B = 1's complement of B + 1

So, by keeping K=1, we get 1's complement of B and By keeping C$_{0}$ = 1, we are adding 1 to 1's complement of B.

edited by
28 votes
28 votes

following operations can be performed by suitably setting the control lines K and C0 only !

It is given that we can not touch B here. B input is fixed.

So suppose we set K = 0, C0 = 0, Then we can perform A + B.

We set K = 1, C0 =0 we can perform A - B.

We can not perform A + 1 because ,even though we can set K = 0, & C0 =1 we can not set B to 0. Though we can computer now A+B+ 1 !

Answer is A !

10 votes
10 votes
A + B: It can be done by setting  K = 0 and Co = 0

A - B: It can be done by setting K = 1 and Co = 1 because here subtraction is done using 2's complement so by K = 1, we are getting 1's complement of B and by Co = 1, we are adding 1 to make 2's complement of B and then adding A and 2's complement of B.

A + 1, A - 1: It can't be performed as B is always there either as B or B' which can't be made 1 by K, C
–3 votes
–3 votes
ans d)
Answer:

Related questions

5 votes
5 votes
0 answers
1
Rishabh Gupta 2 asked Nov 3, 2017
1,159 views
Consider this GATE 2003 question: https://gateoverflow.in/937/gate2003-46Here, instead of XOR gates we had OR gates, then which of the following operations can we perform...
65 votes
65 votes
9 answers
4
Kathleen asked Sep 17, 2014
17,924 views
The following is a scheme for floating point number representation using $16$ bits.Let $s, e,$ and $m$ be the numbers represented in binary in the sign, exponent, and man...