Problem

The grade-school algorithm for multiplying two n-bit binary numbers x and y consists of ad...

The grade-school algorithm for multiplying two n-bit binary numbers x and y consists of adding together n copies of x, each appropriately left-shifted. Each copy, when shifted, is at most 2n bits long.

In this problem, we will examine a scheme for adding n binary numbers, each m bits long, using a circuit or a parallel architecture. The main parameter of interest in this question is therefore the depth of the circuit or the longest path from the input to the output of the circuit. This determines the total time taken for computing the function.

To add two m-bit binary numbers naively, we must wait for the carry bit from position i − 1 before we can figure out the ith bit of the answer. This leads to a circuit of depth O (m). However carry lookahead circuits (see wikipedia.com if you want to know more about this) can add in O (log m) depth.

(a) Assuming you have carry lookahead circuits for addition, show how to add n numbers each m bits long using a circuit of depth

O ((log n)(log m)).


(b) When adding three m-bit binary numbers x + y + z, there is a trick we can use to parallelize the process. Instead of carrying out the addition completely, we can re-express the result as the sum of just two binary numbers r + s, such that the ith bits of r and s can be computed independently of the other bits. Show how this can be done. (Hint: One of the numbers represents carry bits.)


(c) Show how to use the trick from the previous part to design a circuit of depth O (log n) for multiplying two n-bit numbers.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 1