Presentation is loading. Please wait.

Presentation is loading. Please wait.

Multipliers. More complicated than addition accomplished via shifting and addition More time and more area Multiplication What should be the length of.

Similar presentations


Presentation on theme: "Multipliers. More complicated than addition accomplished via shifting and addition More time and more area Multiplication What should be the length of."— Presentation transcript:

1 Multipliers

2 More complicated than addition accomplished via shifting and addition More time and more area Multiplication What should be the length of the storage for the product? 0010 (multiplicand) x_ 1011 (multiplier) 0010 00100 000000 0010000 00010110 0010 (multiplicand) x_ 1011 (multiplier) 0010 x 1 00100 x 1 001000 x 0 0010000 x 1 00010110 Shift the multiplicand, and add partial products if multiplier bit equals 1 Let's look at 3 versions based on gradeschool algorithm What if the available adder is only a full adder?

3 Multiplication: Implementation LSB tells the control unit what operation the ALU should do?

4 Multiplication  If each step took a clock cycle, this algorithm would use almost 100 clock cycles to multiply two 32-bit numbers.  Requires 64-bit wide adder  Multiplicand register 64-bit wide

5 Variations on a Theme Product register has to be 64-bit Can we take advantage of that fact? Yes! Add multiplicand to 32 MSBs product = product >> 1 Repeat last steps New algorithm needs fewer resources

6 Second Version Multiplicand is not shifted to the left, the product now is initially stored in the 32 MSBs then shifted to the right every iteration Note: Mcand is added to the left half only of the Prod reg

7 Critique Registers needed for multiplicand multiplier Product Use lower 32 bits of product register: place multiplier in lower 32 bits add multiplicand to higher 32 bits product = product >> 1 repeat

8 Final Version

9 Multiplying Signed Numbers If sign(a)!=sign(b) then s = true a = abs(a) b = abs(b) p = a*b /* multiply as before */ negate p if s = true Algorithm is straightforward but awkward


Download ppt "Multipliers. More complicated than addition accomplished via shifting and addition More time and more area Multiplication What should be the length of."

Similar presentations


Ads by Google