Skip to content
Official PYQ · 2016

GATE CS 2016 Set 1 Q33 — Computer Arithmetic

Explain with AI

Consider a carry look ahead adder for adding two nn-bit integers, built using gates of fan-in at most two. The time to perform addition using this adder is

Choose one option
View worked solution

Answer: B

To find the time complexity of an nn-bit carry look-ahead adder (CLA) built using gates with a maximum fan-in of 2, we can break down the addition process into three main steps:

  1. Generation of Propagate (pip_i) and Generate (gig_i) signals:

    For each bit ii, we compute: pi=ai⊕biandgi=ai⋅bip_i = a_i \oplus b_i \quad \text{and} \quad g_i = a_i \cdot b_i Since these depend only on the local input bits aia_i and bib_i, they can be computed in parallel in Θ(1)\Theta(1) time using 2-input gates.

  2. Carry Computation:

    The carry CiC_i for each stage is computed using the recurrence relation: Ci=gi−1+pi−1Ci−1C_{i} = g_{i-1} + p_{i-1}C_{i-1} Computing all carries is a prefix computation problem. Since the maximum fan-in of the gates is limited to 22, any circuit combining nn variables to compute the carries must have a tree-like structure (such as a Brent-Kung or Kogge-Stone prefix tree).

    The depth of a binary tree with nn inputs is Θ(log⁡n)\Theta(\log n). Therefore, the time required to propagate and compute all carry signals is Θ(log⁡n)\Theta(\log n).

  3. Sum Computation:

    Once the carries CiC_i are available, the sum bits are computed as: si=pi⊕Cis_i = p_i \oplus C_i This step takes Θ(1)\Theta(1) time using 2-input XOR gates.

Conclusion:
The total time complexity is dominated by the carry computation step, which is Θ(log⁡n)\Theta(\log n).

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Computer Arithmetic questions