Similar question: https://gateoverflow.in/1474/gate1999-1-21

## 4 Answers

Now to MULTIPLY these two Numbers:

- $4$ AND GATEs REQUIRED $B0$ MULTIPLY WITH $A3 \ A2 \ A1 \ A0$.
- $4$ AND GATEs REQUIRED $B1$ MULTIPLY WITH $A3 \ A2 \ A1 \ A0$.
- $4$ BIT ADDER
- $4$ AND GATEs REQUIRED $B2$ MULTIPLY WITH $A3 \ A2 \ A1 \ A0$.
- $4$ BIT ADDER
- $4$ AND GATEs REQUIRED $B3$ MULTIPLY WITH $A3 \ A2 \ A1 \ A0$.
- $4$ BIT ADDER

For $4$ bits, Total Delay$= 3+4=7$

For $n$ bits, Total Delay$=n-1+n = 2n-1$

So, Total Delay $=\Theta(n).$

Correct Answer: $C$

### 9 Comments

@VS ji. Thanks for valuable effort. Just small addition if look ahead carry adder is used then 4-Unit of delay in each adder. But it will not change answer because 4 is a constant with respect to n.

In the diagram they are using simple adder only (having carry propagated to next bit level sequentially). But then also the adder will take O(1) time instead of O(n) time can be explained by implementation below. We are not propagating carry to the same level rather we are propagating that carry to next level.Which helps us to implement the adder in O(1) by parallely generating the sum as (Ai xor Bi) and carry as (Ai and Bi) for ever i.

The implementation is using the fact that when we have to add the three bits and an outstanding carry the result is independent of when we add carry. Example we have to add 5,4 and 3 with carry as 1, then we can add first (5+4+carry) and then add 3 or we can add first (5+4) and then add (9+3+carry) result would be same.

B= B1 B2 B3 B4

NOW TO MULTIPLY THESE TWO NUMBER .

1 AND GATE REQUIRE B1 MULTIPLY WITH A1 A2 A3 A4.

1 AND GATE REQUIRE B2 MULTIPLY WITH A1 A2 A3 A4.

1 AND GATE REQUIRE B3 MULTIPLY WITH A1 A2 A3 A4.

1 AND GATE REQUIRE B4 MULTIPLY WITH A1 A2 A3 A4.

NOW 3 OR GATE REQUIRE.

TOTAL 7 GATE REQUIRE FOR 4 BIT TAKE N BIT U FIND 2N-1.

SO TIME COMPLEXITY WILL BE = ϴ(n)

### 2 Comments

Diagramatic answer seems to helpful. But still dont know how to drive the equation "So the delay is approxiamtely sqrt(2)*(2n-1)."

http://stackoverflow.com/questions/27095216/time-complexity-in-n-bit-array-multiplication