1 / 9

Multipliers

Multipliers. Multiplication. More complicated than addition accomplished via shifting and addition More time and more area. Shift the multiplicand, and add partial products if multiplier bit equals 1. Let's look at 3 versions based on gradeschool algorithm. 0010 (multiplicand)

gore
Download Presentation

Multipliers

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Multipliers

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

  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 Note: Mcand is added to the left half only of the Prod reg Multiplicand is not shifted to the left, the product now is initially stored in the 32 MSBs then shifted to the right every iteration

  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

More Related