GATE / CS ARCHIVE

SIMILAR QUESTIONS / COMPUTER ORGANIZATION & ARCHITECTURE

Trace a registered ripple-addition stream

2 questions solved the same way, newest first. Back to Computer Organization & Architecture

How these are solved

Follow sums, carry and delayed operand bits across R0, R1 and R2, whose loads occur simultaneously at falling edges. The final full adder is unregistered.

Descriptive
Report issue

Trace the registered three-bit adder

Pipelining & Hazards

Question 8(a), GATE 2002: The circuit takes three-bit inputs A=a₂a₁a₀ and B=b₂b₁b₀ and produces Z=z₃z₂z₁z₀. All registers load simultaneously on falling CLOCK edges; the clock period exceeds every circuit’s settling time. The diagram has R0 (6 bits) holding b₂,a₂,b₁,a₁,b₀,a₀. A full adder takes R0’s b₀,a₀ with carry-in 0. R1 (6 bits) holds the forwarded b₂,a₂,b₁,a₁ and this adder’s carry and sum. A second full adder takes R1’s b₁,a₁ and that stored carry. R2 (5 bits) holds the forwarded b₂,a₂, the second adder’s carry and sum, and the forwarded least-significant sum. A third, unregistered full adder takes R2’s b₂,a₂ and stored carry; its carry and sum are z₃,z₂, while R2’s stored sums directly provide z₁,z₀. Initially R0, R1, R2 are all zero. For clock numbers 1 through 8, A is [110,011,111,101,000,000,000,000] and B is [101,101,011,110,000,000,000,000]. Determine the sequence of eight four-bit output values Z.
Question 8(a), GATE 2002: The circuit takes three-bit inputs A=a₂a₁a₀ and B=b₂b₁b₀ and produces Z=z₃z₂z₁z₀. All registers load simultaneously on falling CLOCK edges; the clock period exceeds every circuit’s settling time. The diagram has R0 (6 bits) holding b₂,a₂,b₁,a₁,b₀,a₀. A full adder takes R0’s b₀,a₀ with carry-in 0. R1 (6 bits) holds the forwarded b₂,a₂,b₁,a₁ and this adder’s carry and sum. A second full adder takes R1’s b₁,a₁ and that stored carry. R2 (5 bits) holds the forwarded b₂,a₂, the second adder’s carry and sum, and the forwarded least-significant sum. A third, unregistered full adder takes R2’s b₂,a₂ and stored carry; its carry and sum are z₃,z₂, while R2’s stored sums directly provide z₁,z₀. Initially R0, R1, R2 are all zero. For clock numbers 1 through 8, A is [110,011,111,101,000,000,000,000] and B is [101,101,011,110,000,000,000,000]. Determine the sequence of eight four-bit output values Z.
Question 8(a), GATE 2002: The circuit takes three-bit inputs A=a₂a₁a₀ and B=b₂b₁b₀ and produces Z=z₃z₂z₁z₀. All registers load simultaneously on falling CLOCK edges; the clock period exceeds every circuit’s settling time. The diagram has R0 (6 bits) holding b₂,a₂,b₁,a₁,b₀,a₀. A full adder takes R0’s b₀,a₀ with carry-in 0. R1 (6 bits) holds the forwarded b₂,a₂,b₁,a₁ and this adder’s carry and sum. A second full adder takes R1’s b₁,a₁ and that stored carry. R2 (5 bits) holds the forwarded b₂,a₂, the second adder’s carry and sum, and the forwarded least-significant sum. A third, unregistered full adder takes R2’s b₂,a₂ and stored carry; its carry and sum are z₃,z₂, while R2’s stored sums directly provide z₁,z₀. Initially R0, R1, R2 are all zero. For clock numbers 1 through 8, A is [110,011,111,101,000,000,000,000] and B is [101,101,011,110,000,000,000,000]. Determine the sequence of eight four-bit output values Z.
Tap to enlarge
Shared context

A and B are unsigned three-bit operands. All three registers R0, R1, R2 load on the same falling clock edge. The source circuit stages three full adders and delays higher input bits and lower result bits to keep each operand pair aligned. All registers initially contain zero.

Answer & solution

Answer: 0000, 0000, 1011, 1000, 1010, 1011, 0000, 0000 (no official key was published)

1. Read the timing rule before doing arithmetic. R0, R1, and R2 load simultaneously on every falling edge. A downstream register therefore samples the old contents of the register before it, not the new value arriving during that same edge. Read Z after the final full adder has settled.

2. Follow one input pair through the circuit. Pair t enters R0 at edge t. Its low-bit sum and carry enter R1 at edge t+1. Its middle-bit sum and carry enter R2 at edge t+2, after which the last full adder produces the high sum bit and final carry. The delayed low bits complete the four-bit output. Thus the input captured at edge 1 first appears as a complete sum after edge 3.

3. Compute the first four operand sums, preserving the carry bit:

Input pair    A     B     Decimal sum     Four-bit sum
    1        110   101       6+5=11            1011
    2        011   101       3+5=8             1000
    3        111   011       7+3=10            1010
    4        101   110       5+6=11            1011
    5–8      000   000       0+0=0             0000

4. Check the first sum at bit level. For 110 + 101, bit 0 gives 0+1+0 = 1, so s0=1,c1=0. Bit 1 gives 1+0+0 = 1, so s1=1,c2=0. Bit 2 gives 1+1+0 = 2, so s2=0,c3=1. The result c3s2s1s0 is 1011.

5. Apply the two-edge delay and the all-zero initial register contents. The requested sequence is:

Clock edge       1     2     3     4     5     6     7     8
Z after settling 0000  0000  1011  1000  1010  1011  0000  0000
Source input     init  init   1     2     3     4     5     6

The initial two outputs come from the zero-filled pipeline. Input pairs 7 and 8 have not yet reached the output at edge 8. Register-by-register synchronous simulation verifies all eight reported outputs.

Original paper, page 7

Descriptive
Report issue

Identify the pipelined arithmetic circuit

Data Representation & Arithmetic

Question 8(b), GATE 2002: The circuit takes three-bit inputs A=a₂a₁a₀ and B=b₂b₁b₀ and produces Z=z₃z₂z₁z₀. All registers load simultaneously on falling CLOCK edges; the clock period exceeds every circuit’s settling time. The diagram has R0 (6 bits) holding b₂,a₂,b₁,a₁,b₀,a₀. A full adder takes R0’s b₀,a₀ with carry-in 0. R1 (6 bits) holds the forwarded b₂,a₂,b₁,a₁ and this adder’s carry and sum. A second full adder takes R1’s b₁,a₁ and that stored carry. R2 (5 bits) holds the forwarded b₂,a₂, the second adder’s carry and sum, and the forwarded least-significant sum. A third, unregistered full adder takes R2’s b₂,a₂ and stored carry; its carry and sum are z₃,z₂, while R2’s stored sums directly provide z₁,z₀. What operation does this circuit implement?
Question 8(b), GATE 2002: The circuit takes three-bit inputs A=a₂a₁a₀ and B=b₂b₁b₀ and produces Z=z₃z₂z₁z₀. All registers load simultaneously on falling CLOCK edges; the clock period exceeds every circuit’s settling time. The diagram has R0 (6 bits) holding b₂,a₂,b₁,a₁,b₀,a₀. A full adder takes R0’s b₀,a₀ with carry-in 0. R1 (6 bits) holds the forwarded b₂,a₂,b₁,a₁ and this adder’s carry and sum. A second full adder takes R1’s b₁,a₁ and that stored carry. R2 (5 bits) holds the forwarded b₂,a₂, the second adder’s carry and sum, and the forwarded least-significant sum. A third, unregistered full adder takes R2’s b₂,a₂ and stored carry; its carry and sum are z₃,z₂, while R2’s stored sums directly provide z₁,z₀. What operation does this circuit implement?
Question 8(b), GATE 2002: The circuit takes three-bit inputs A=a₂a₁a₀ and B=b₂b₁b₀ and produces Z=z₃z₂z₁z₀. All registers load simultaneously on falling CLOCK edges; the clock period exceeds every circuit’s settling time. The diagram has R0 (6 bits) holding b₂,a₂,b₁,a₁,b₀,a₀. A full adder takes R0’s b₀,a₀ with carry-in 0. R1 (6 bits) holds the forwarded b₂,a₂,b₁,a₁ and this adder’s carry and sum. A second full adder takes R1’s b₁,a₁ and that stored carry. R2 (5 bits) holds the forwarded b₂,a₂, the second adder’s carry and sum, and the forwarded least-significant sum. A third, unregistered full adder takes R2’s b₂,a₂ and stored carry; its carry and sum are z₃,z₂, while R2’s stored sums directly provide z₁,z₀. What operation does this circuit implement?
Question 8(b), GATE 2002: The circuit takes three-bit inputs A=a₂a₁a₀ and B=b₂b₁b₀ and produces Z=z₃z₂z₁z₀. All registers load simultaneously on falling CLOCK edges; the clock period exceeds every circuit’s settling time. The diagram has R0 (6 bits) holding b₂,a₂,b₁,a₁,b₀,a₀. A full adder takes R0’s b₀,a₀ with carry-in 0. R1 (6 bits) holds the forwarded b₂,a₂,b₁,a₁ and this adder’s carry and sum. A second full adder takes R1’s b₁,a₁ and that stored carry. R2 (5 bits) holds the forwarded b₂,a₂, the second adder’s carry and sum, and the forwarded least-significant sum. A third, unregistered full adder takes R2’s b₂,a₂ and stored carry; its carry and sum are z₃,z₂, while R2’s stored sums directly provide z₁,z₀. What operation does this circuit implement?
Tap to enlarge
Shared context

A and B are unsigned three-bit operands. All three registers R0, R1, R2 load on the same falling clock edge. The source circuit stages three full adders and delays higher input bits and lower result bits to keep each operand pair aligned. All registers initially contain zero.

Answer & solution

Answer: Pipelined unsigned three-bit binary adder, producing a four-bit sum (no official key was published)

1. Identify each arithmetic stage from the source diagram. The first full adder takes a0, b0, and carry-in 0. It produces the least significant sum bit s0 and carry c1. R1 stores those values together with the delayed higher operand bits.

2. Follow the carry to the next stage. The second full adder takes a1, b1, and that same operand pair’s carry c1. It produces s1 and c2. R2 stores these along with the delayed a2,b2 and s0.

3. Finish the sum. The last full adder takes a2,b2,c2 and outputs s2 plus the carry c3. The circuit combines these with the delayed low bits as Z = c3s2s1s0. Consequently the four-bit unsigned result is exactly A+B; the leading carry is retained rather than discarded.

4. Explain why the registers matter. They delay the remaining operand bits and previously computed low sum bits along with the carry. This keeps all four output bits associated with one input pair while different pairs occupy different stages. Without those matching delays, bits from different pairs could be mixed.

5. Identify the implementation and performance. It is a pipelined unsigned three-bit binary adder, accepting a new pair each clock and producing one four-bit sum per clock after filling. A pair captured by R0 at edge t appears at Z after edge t+2 and combinational settling. It passes through three register loads, R0, R1, R2; there are two full clock intervals between its first capture and final output. This explicit convention avoids an ambiguous bare latency number.

Original paper, page 7