GATE / CS ARCHIVE

GATE CSE 2002 / QUESTION 8(a)

Trace the registered three-bit adder

Computer Organization & Architecture · Pipelining & Hazards · Full GATE CSE 2002 paper

GATE 2002, Q8(a) Descriptive
Report issue

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