1 / 67

Sequential Multipliers

Lecture 9. Sequential Multipliers. Required Reading. Behrooz Parhami, Computer Arithmetic: Algorithms and Hardware Design. Chapter 9, Basic Multiplication Scheme Chapter 10, High-Radix Multipliers Chapter 12.3, Bit-Serial Multipliers Chapter 12.4, Modular Multipliers. Notation.

pules
Download Presentation

Sequential 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. Lecture 9 Sequential Multipliers

  2. Required Reading Behrooz Parhami, Computer Arithmetic: Algorithms and Hardware Design Chapter 9, Basic Multiplication Scheme Chapter 10, High-Radix Multipliers Chapter 12.3, Bit-Serial Multipliers Chapter 12.4, Modular Multipliers

  3. Notation a Multiplicand ak-1ak-2 . . . a1 a0 x Multiplier xk-1xk-2 . . . x1 x0 p Product (a  x) p2k-1p2k-2 . . . p2 p1 p0 If multiplicand and multiplier are of different sizes, usually multiplier has the smaller size

  4. Multiplication of two 4-bit unsigned binarynumbers in dot notation Partial Product 0 Partial Product 1 Partial Product 2 Partial Product 3 Number of partial products = number of bits in multiplier x Bit-width of each partial product = bit-width of multiplicand a

  5. Basic Multiplication Equations k-1 x = xi  2i p = a  x i=0 k-1 p = a  x = a  xi  2i = = x0a20 + x1a21 + x2a22 + … + xk-1a2k-1 i=0

  6. Shift/Add Algorithm Right-shift version

  7. Shift/Add Algorithms Right-shift algorithm p = a  x = x0a20 + x1a21 + x2a22 + … + xk-1a2k-1 = = (...((0 + x0a2k)/2 + x1a2k)/2 + ... + xk-1a2k)/2 = k times p(0) = 0 j=0..k-1 p(j+1) = (p(j) + xj a 2k) / 2 p = p(k)

  8. Sequential shift-and-add multiplier for right-shift algorithm

  9. Right-shift multiplication algorithm: Example

  10. Area optimization for the sequential shift-and-add multiplier with the right-shift algorithm

  11. Shift/Add Algorithms Right-shift algorithm: multiply-add p(0) = y2k j=0..k-1 p(j+1) = (p(j) + xj a 2k) / 2 p = p(k) = (...((y2k + x0a2k)/2 + x1a2k)/2 + ... + xk-1a2k)/2 = k times = y + x0a20 + x1a21 + x2a22 + … + xk-1a2k-1 = y + a  x

  12. Signed Multiplication • Previous sequential multipliers are for unsigned multiplication • For signed multiplication: • assume sign-extended operation for p(j) + xja • if 2's complement multiplier is POSITIVE right-shift sequential algorithms (shift-add) will work directly • if 2's complement multiplier is NEGATIVE than we must use "negative weight” for xk-1 and subtract xk-1a in the last cycle • Slight increase in area due to control and one-bit sign extension on inputs of adder • Unsigned: k bit number + k bit number  k+1 bit number • Signed: k+1 bit sign extended number + k+1 bit sign extended number  k+1 bit number

  13. Sequential multiplication of 2’s-complement numbers with right shifts (positive multiplier)

  14. Sequential multiplication of 2’s-complement numbers with right shifts (negative multiplier)

  15. Shift/Add Algorithm Left-shift version

  16. Shift/Add Algorithms Left-shift algorithm p = a  x = x0a20 + x1a21 + x2a22 + … + xk-1a2k-1 = = (...((02 + xk-1a)2 + xk-2a)2 + ... + x1a)2 + x0a= k times p(0) = 0 j=0..k-1 p(j+1) = (p(j) 2 + xk-1-ja) p = p(k)

  17. Sequential shift-and-add multiplier for left-shift algorithm Left shifts are not as efficient fortwo's complement because mustsign extend multiplicand by k bits

  18. Left-shift multiplication algorithm: Example

  19. Shift/Add Algorithms Left-shift algorithm: multiply-add p(0) = y2-k j=0..k-1 p(j+1) = (p(j) 2 + xk-(j+1)a) p = p(k) = (...((y2-k2 + xk-1a)2 + xk-2a)2 + ... + x1a)2 + x0a = k times = y + xk-1a2k-1 + xk-2a2k-2 + … + x1a21 + x0a= y + a  x

  20. Shift/Add Algorithm Right-shift version with Carry-Save Adder

  21. Sequential shift-and-add multiplier with a carry save adder

  22. High-Radix Sequential Multipliers

  23. High-Radix Notation a Multiplicand (an-1an-2 . . . a1 a0)r x Multiplier (xn-1xn-2 . . . x1 x0)r p Product (a  x) (p2n-1p2n-2 . . . p2 p1 p0)r

  24. Radix-4, or two-bit-at-a-time, multiplication indot notation

  25. Basic Multiplication Equations n-1 x = xi  ri p = a  x i=0 n-1 p = a  x = a xi  ri = = x0ar0 + x1a r1 + x2a r2 + … + xn-1a rn-1 i=0

  26. High-Radix Shift/Add Algorithms Right-shift high-radix algorithm p = a  x = x0ar0 + x1ar1 + x2ar2 + … + xn-1arn-1 = = (...((0 + x0arn)/r + x1arn)/r + ... + xn-1arn)/r = n times p(0) = 0 j=0..n-1 p(j+1) = (p(j) + xj a rn) / r p = p(n)

  27. High-Radix Shift/Add Algorithms Left-shift high-radix algorithm p = a  x = x0ar0 + x1ar1 + x2ar2 + … + xn-1arn-1 = = (...((0r + xn-1a)r + xn-2a)r + ... + x1a)r + x0a= n times p(0) = 0 j=0..n-1 p(j+1) = (p(j)  r + xn-1-ja) p = p(n)

  28. The multiple generation part of a radix-4 multiplier with precomputation of 3a

  29. Example of radix-4 multiplication using the 3amultiple

  30. The multiple generation part of a radix-4 multiplier based on replacing 3a with 4a (carryinto next higher radix-4 multiplier digit) and -a

  31. Higher Radix Multiplication • In radix-8, one must precompute 3a, 5a, 7a • Overhead becomes prohibitive and does not help • However, when we discuss CSA this may be useful

  32. Radix-2 Booth Recoding j j+1 i

  33. Radix-2 Booth Recoding yi = -xi + xi-1

  34. Sequential multiplication of 2’s-complement numbers with right shifts using Booth’s recoding

  35. Notation Y Multiplicand ym-1ym-2 . . . y1 y0 X Multiplier xm-1xm-2 . . . x1 x0 P Product (Y  X ) p2m-1p2m-2 . . . p2 p1 p0 If multiplicand and multiplier are of different sizes, usually multiplier has the smaller size

  36. Radix-2 Booth Multiplier Basic Step

  37. Radix-2 Booth Multiplier Basic Step in Xilinx FPGAs

  38. Radix-2 Booth Multiplier in Xilinx FPGAs

  39. Radix-4 Booth Recoding (1) -1 0 1 0 0 -1 1 0 -1 1 -1 1 0 0 -1 0

  40. zi/2 = -2xi+1 + xi + xi-1

  41. Example radix-4 multiplication with modified Booth’s recoding of the 2’s-complement multiplier

  42. The multiple generation part of a radix-4 multiplier based on Booth’s recoding

  43. Notation Y Multiplicand ym-1ym-2 . . . y1 y0 X Multiplier xm-1xm-2 . . . x1 x0 P Product (Y  X ) p2m-1p2m-2 . . . p2 p1 p0 If multiplicand and multiplier are of different sizes, usually multiplier has the smaller size

  44. Radix-4 Booth Multiplier Basic Step

  45. Radix-4 Booth Multiplier: Left Shifter & Control

  46. High-Radix Multipliers with Carry-Save Adder

  47. Radix-4 multiplication with a carry-save adder used to combine the cumulative partial product,xia, and 2xi+1a into two numbers

  48. Radix-4 multiplier with a carry-save adder and Booth’s recoding

  49. Booth recoding and multiple selection logic forhigh-radix multiplication

  50. Radix-4 multiplier with two carry-save adders

More Related