6.7k views
Consider an eight-bit ripple-carry adder for computing the sum of $A$ and $B$, where $A$ and $B$ are integers represented in $2$'s complement form. If the decimal value of $A$ is one, the decimal value of $B$ that leads to the longest latency for the sum to stabilize is ___________
| 6.7k views
0
0
****
+1
@viv696 what will be the value of B that leads to the minimum latency for the sum to be stabilize ?
0
@MiNiPanda

What does stabilize means exactly ?
+1
Stabilize means after certain amount of steps result would not be change.
0

longest latency for the sum to stabilize

What does this statement means actually ??

+2

A=00000001=1(in 2's complement form ),B=-1=11111111(in 2's complement form)

In case of -1  we get bit sequence $11111111$ adding this we get a carry upto carry flag, so largest time to ripple!
by Active (2.3k points)
edited
+4
Can you explain the problem little bit and the solution? It will be a great help.

Thank you.
+3
decimal value of A is 1..does it mean positive 1 or negative 1??but if it is a 8 bit representation,then positive 1 in binary is 00000001 conveeting to 2'complement,we will gt 11111111.which has sign bit as 1 and hence,considered as negative.so,dun we need 1 more bit to represent +1 in 2 'complemenmt for sign bit??
+1
can you explain it again i m not getting
0
@Ankit and @Hemant you will write -1 as a 1111111 in 2's complement but 127 will be 01111111 show see these bits -1 has contain 1 more carry bit for caculation show it will take 1 bit more latency time for calculation.
0
@Brij Mohan Gupta

What is 2's complement of 1?
+1
stabilize means sum should be 0.rt?

how 127 making sum stabilized in 2's complement form?

It is not signed or unsigned form ,right?
+1
@srestha question is asking for which input circuit take longest delay(latency) for calculation, It's not means to calculate zero . When all the bits are one then system will take longest delay to caculate carry and sum as well.
+10

@ Brij

here we are adding A and B

A =0000 0001 (in 2's complement form)

Now if B=127=0111 1111

127 means it is end point of positive number

Now if we add 1 with it will go to 0 (stabilize means go to all bits are 0 or all bits are 1)

Another one procedure could be add -1 with add with +1 to get 0

2's complement of -1 is 1000 0001

It is also stabilize in 2's complement will be 0 (As +0 and -0 is same for 2's complement)

Now if we add 1000 0001 with 0000 0001 we have to go upto 8th bit (while for 127 we have to calculate upto 7th bit)

which is 1 more bit than addition with 127

That is the cause of taking -1 as largest latency

0

But if we think about largest latency means generating carry in each bit and also generating sum in each bit then 127 will be right answer.

Because 127 adding with 1 generating carry in each bit, but in -1 adding with 1 will not generate carry in each bit.

rt?

0
What do you think if B=-127. Please let me know.
It will also give the correct result. In this case also carry will propagate throughout and sum will change.
0
@Srestha 2's complement of -1 is 1000 0001 .. how ??
0
@Puja

Sign bit 1 means number is -ve

Sign bit 0 means number is +ve
0
ok got it ... my mistake ...
+11
2's complement of $-1$ is $=11111111$
0

srestha  nice explanation

0
Is the decimal value of A represents the value of the 8-bits stored in A in the 2's complement form, or is it the "actual" value of A which, in 2's complement, becomes 111111111?

0

Can we say that B cannot be equal to 127 coz Adding 127 and 1 gives 128 $\Rightarrow$ Overflow?

In ripple-carry adder, the carry "ripples" from one bit to the next. The longest path delay through n-bit ripple carry adder is 2n gate delays.

For this condition (longest latency) to arise, we must ensure that a carry that is generated at the least significant bit is propagated throughout till the last bit. This means we must have Cin = 1 for every stage of the ripple-carry adder.

Given A = +1 (in 2's complement form), we just need to find what should be B in 2's complement form to satisfy the given condition.

A= 0000 0001  (given)

B= 1111 1111 ( -1 in decimal)

On adding A+B we get Cin = 1 at every stage with the last Cout = 1.         $\therefore$ Ans is  -1.

by Junior (955 points)
0
Nicely explained!
why not 127????? worst cse occurs means longest time to stabilize when all generate a carry..so 127 satisfies this requirememnt
by (299 points)
+1
in case of 127, the sum will settle in 2 stage delays. In case of -1, the sum will take 8 stage delays to settle.
0
but I am not getting difference
+5
-1 will have one more carry compared to 127.
+4
but that is the last one, and it doesn't make effect in sum .
0
@Praveen , if there are multiple answers then this will become marks to all ( Usually there are always few questions with marks to all  in every paper!)
0
for sum there are 2 XOR,

for carry there is 1 XOR,1 AND and  1 OR.

i.e total 3 gate delays in case of carry and 2 gate delays in sum.

so in case of -1 the carry bit will change and thus it will take 1 extra gate delay.
0
sir plz explain why u not satisfied with the answer -1???

is there any other posibility?
+1
@abhishek you will write -1 as a 1111111 in 2's complement but 127 will be 01111111 show see these bits -1 has contain 1 more carry bit for caculation show it will take 1 bit more latency time for calculation.
0
What do you think if B=-127. Please let me know.
It will also give the correct result. In this case also carry will propagate throughout and sum will change.
0

Mk Utkarsh $(-127)_{10}=(10000001)_{2}$ in 2's complement

-1 and -127 both will give correct ans to this question.

-1 :    1111 1111
-1 :    1111 1111
+  : 1 1111 1110

-1     :     1111   1111
-127 :    1000 0001
+      : 1 1000 0000

In both cases carry is propagating throughout. In case of (-1,-1) sum is getting stabilized from 0000 0000 to 1111 11110

In case of (-1,-127) sum is getting stabilized from 0111 1110 to 1000 0000.
by (341 points)
edited
0
-127 does not cause the same delay as -1.
0
In case of (-1,-127) sum is getting stabilized from 0111 1110 to 1000 0000. Carry moves from LSB to MSB and overflows in the end. So its the same case as (-1,-1).
0
Decimal value of A is 1, are you trying to change that?

-127 will not cause sae delay as -1
+2

Ashish Sharma 3  1 in 2's complement is 1 only since its a positive number, and in all signed number representations all positive numbers are treated the same, so in place of -1 as A you should add

1:   00000001 (A)

-127:10000001 (B)

+: 10000010  Sum

If B=-1; then:

1:   00000001 (A)

-1: 11111111  (B)

+: 1 00000000   sum,so you can figure out which among -1 and -127 will take more latency for sum to be stabilized..

Here A and B both are in 2's complement form.+1 is 00000001,-1 is 11111111.

by Active (1.8k points)