Question
Consider an eight-bit ripple-carry adder for computing the sum of and , where and are integers represented in 2's complement form. If the decimal value of is one, the decimal value of that leads to the longest latency for the sum to stabilize is ________.
Official answer and solution
- Official answer
- -1
- From
- Official GATE 2016 answer key
Solution
Identify the bit pattern required to propagate the carry across all 8 stages of the ripple-carry adder.
In an 8-bit ripple-carry adder, each 1-bit full adder () computes:
The latency is maximal when a carry is generated at the least significant bit () and ripples through all subsequent bits up to bit 7 ().
Given , its 8-bit representation is:
So and for all .
To achieve maximum propagation delay:
- At bit 0: With , a carry must be generated: .
- At each bit (): Since , the carry propagation condition is:To ensure whenever , we must have for all .
Thus, the required 8-bit value of is:
In 8-bit 2's complement representation:
Therefore, the decimal value of is -1.
-1
Interpreting 11111111 as 255 (unsigned) rather than -1 (signed 2's complement).
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2016 Computer Science and Information Technology (CS) Session 2
- Question
- 17 of 65, printed as CS Q.7
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.