Computer Sciences > Gate 2016 Set-1 > Full Adder
Consider a carry lookahead adder for adding two n-bit integers, built using gates of fan-in at most two. The time to perform addition using this adder is
A
Θ(1)
B
Θ(log (n))
C
Θ(√ n)
D
Θ(n)

Correct : F

Given:
Carry lookahead adder for adding two n-bit integers.
Gates have a maximum fan-in of 2.
To find:
The time required to perform the addition.
Solution:
Let me recall how carry lookahead adder works with restricted fan-in.
First, to compute the generate (gi = ai bi) and propagate (pi = ai ⊕ bi) terms for each bit, we only need 2-input gates.
So computing all gi and pi takes constant time, which is Θ(1).
Now, to compute the carries, each carry bit ci depends on up to i variables.
Since the fan-in of each gate is at most 2, an operation combining n inputs requires a binary tree of gates.
The height (or depth) of a balanced binary tree with n inputs is given by log2(n).
Thus, computing prefix carries using a tree structure takes time proportional to the depth of the tree, which is Θ(log n).
Finally, computing the sum bits si = pi ⊕ ci takes one more XOR gate delay, which is Θ(1).
Adding all these delays up, the total time required is:
Total time = Θ(1) + Θ(log n) + Θ(1) = Θ(log n).
Answer:
(B) Θ(log (n))

Similar Questions

A palindrome is a word that reads the same forwards and backwards. In a game of words, a player has the following two plates painted with letters. From...
#1 MCQ
Which number does not belong in the series below? 2, 5, 10, 17, 26, 37, 50, 64
#4 MCQ
Choose the word that is opposite in meaning to the word “coherent”.
#5 MCQ

Related Topics

carry lookahead adder computer science gate 2016 addition time complexity binary adder speed Θ(1) complexity log n complexity sqrt n complexity n complexity questions

Unique Visitor Count

Total Unique Visitors

Loading......