html5-img
1 / 44

Fast Dividers

Lecture 10. Fast Dividers. Required Reading. Behrooz Parhami, Computer Arithmetic: Algorithms and Hardware Design. Chapter 14, High-Radix Dividers Note errata at: http://www.ece.ucsb.edu/~parhami/text_comp_arit_1ed.htm#errors. Recommended Reading. J-P. Deschamps, G. Bioul, G. Sutter,

basil
Télécharger la présentation

Fast Dividers

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 10 Fast Dividers

  2. Required Reading Behrooz Parhami, Computer Arithmetic: Algorithms and Hardware Design Chapter 14, High-Radix Dividers Note errata at: http://www.ece.ucsb.edu/~parhami/text_comp_arit_1ed.htm#errors

  3. Recommended Reading J-P. Deschamps, G. Bioul, G. Sutter, Synthesis of Arithmetic Circuits: FPGA, ASIC and Embedded Systems Chapter 6, Arithmetic Operations: Division 6.2.4, SRT Radix-2 Division 6.2.5, SRT Radix-2 Division with Stored Carry Encoding 6.2.6, P-D Diagram 6.2.7, SRT-4 Division Chapter 13, Dividers 13.2.3, SRT Dividers 13.2.4, SRT-4 Divider

  4. Classification of Dividers Array Dividers Dividers by Convergence Sequential Radix-2 High-radix • Restoring • Non-restoring • regular • SRT • regular using carry save adders • SRT using carry save adders

  5. Array Dividers

  6. Unsigned Fractional Division zfrac Dividend .z-1z-2 . . . z-(2k-1)z-2k dfrac Divisor .d-1d-2 . . . d-(k-1) d-k qfrac Quotient .q-1q-2 . . . q-(k-1) q-k sfrac Remainder .000…0s-(k+1) . . . s-(2k-1) s-2k k bits

  7. Integer vs. Fractional Division For Integers: z = q d + s  2-2k z 2-2k = (q 2-k) (d 2-k) + s (2-2k) For Fractions: zfrac = qfrac dfrac + sfrac where zfrac = z 2-2k dfrac = d 2-k qfrac = q 2-k sfrac = s 2-2k

  8. Unsigned Fractional Division Overflow Condition for no overflow: zfrac < dfrac

  9. Sequential Fractional Division Basic Equations s(0) = zfrac s(j) = 2 s(j-1) - q-j dfrac 2k · sfrac = s(k) sfrac = 2-k · s(k)

  10. Restoring Unsigned Fractional Division s(0) = z for j = 1 to k if 2 s(j-1) - d > 0 q-j = 1 s(j) = 2 s(j-1) - d else q-j = 0 s(j) = 2 s(j-1)

  11. Fig. 15.7 Restoring array divider composed of controlledsubtractor cells.

  12. Non-Restoring Unsigned Fractional Division s(-1) = z-d for j = 0 to k-1 if s(j-1) 0 q-j = 1 s(j) = 2 s(j-1) - d else q-j = 0 s(j) = 2 s(j-1) + d end forif s(k-1)  0 q-k = 1 else q-k = 0 Correction step

  13. Fig. 15.8 Nonrestoring array divider built of controlledadd/subtract cells.

  14. Sequential Dividers

  15. Sequential Fractional Division Basic Equations s(0) = zfrac s(j) = 2 s(j-1) - q-j dfrac 2k · sfrac = s(k) sfrac = 2-k · s(k)

  16. Non-restoring Fractional Division s(0) = z for j = 1 to k if2s(j-1) 0 q-j = 1 s(j) = 2 s(j-1) - d else q-j = -1 s(j) = 2 s(j-1) + d end for q = BSD_2’s_comp_conversion(q) Correction_step

  17. Integer Division Correction step We have: z = q d + s We need: sign(s) = sign (z) z = (q-1) d + (s+d) z = q’ d + s’ z = (q+1) d + (s-d) z = q” d + s”

  18. Fractional Division Correction step We have: zfrac = qfrac dfrac + sfrac We need: sign(sfrac) = sign(zfrac) zfrac = (qfrac–2-k) dfrac + (sfrac+dfrac 2-k) zfrac = q’frac dfrac + s’frac zfrac = (qfrac+2-k) dfrac + (sfrac –dfrac 2-k) zfrac = q”frac dfrac + s”frac

  19. Non-restoring Fractional Division s(0) = z for j = 1 to k if2s(j-1) 0 q-j = 1 s(j) = 2 s(j-1) - d else q-j = -1 s(j) = 2 s(j-1) + d end for q = BSD_2’s_comp_conversion(q) Correction_step

  20. Fig. 14.3 The new partial remainder, s(j), as a function of the shifted old partial remainder, 2s(j–1), in radix-2 nonrestoring division.

  21. Fig. 14.4 The new partial remainder s(j) as a function of 2s(j–1), with q–j in {–1, 0, 1}.

  22. Non-restoring Fractional Division with shifting over zeros s(0) = z for j = 1 to k if2s(j-1) d q-j = 1 s(j) = 2 s(j-1) - d elseif 2s(j-1) < -d q-j = -1 s(j) = 2 s(j-1) + d else q-j = 0 s(j) = 2 s(j-1) end for Conversion of q Correction step

  23. SRT Non-Restoring Fractional Division Assumptions d  1/2 (positive, bit-normalized divider) -d ≤ -1/2 ≤ z, s(j) < 1/2 < d If the latter condition not true: z = z >> 1 perform k+1 instead of k steps of the algorithm q = q << 1 and s = s << 1 z’=z/2 and z’=q’·d + s’ z = 2z’ = (2q’) ·d + 2s’=q ·d + s

  24. Fig. 14.5 The relationship between new and old partial remainders in radix-2 SRT division.

  25. SRT Non-Restoring Fractional Division s(0) = z for j = 1 to k if2s(j-1)  1/2 q-j = 1 s(j) = 2 s(j-1) - d elseif 2s(j-1) < -1/2 q-j = -1 s(j) = 2 s(j-1) + d else q-j = 0 s(j) = 2 s(j-1) end for Conversion of q Correction step

  26. Fig. 14.6 Example of unsigned radix-2 SRT division.

  27. Sequential Dividers with Carry-Save Adders

  28. Fig. 14.8 Block diagram of a radix-2 divider with partialremainder in stored-carry form.

  29. 1 2 Using Carry-Save Adders with the Dividers sum = u = u1u0.u-1u-2u-3u-4….u-k carry = v = v1v0.v-1v-2v-3v-4….v-k t = u1u0.u-1u-2 + v1v0.v-1v-2 u + v - t = 00.00u-3u-4….u-k + 00.00v-3v-4….v-k < 0 

  30. 1 1 1 1 1 2 2 2 2 2 Using Carry-Save Adders with the Dividers - 0 t - t < -  t < 0 t  0 -  u+v < u+v  0 u+v < 0 q-j = -1 q-j = 0 q-j = 1

  31. Fig. 14.7 Constant thresholds used for quotient digitselection in radix-2 division with qk–j in {–1, 0, 1}.

  32. p-d Plot for Radix-2 Division Fig. 14.10 A p-d plot for radix-2 division with d[1/2,1), partial remainder in[–d, d), and quotient digits in [–1, 1].

  33. High-Radix Sequential Dividers

  34. Radix-4 division in dot notation

  35. New Versus Shifted Old Partial Remainder in Radix-4 Division Radix-4 fractional division with left shifts and q–j [–3, 3] s(j) = 4s(j–1)– q–jd with s(0) = z and s(k) = 4ks |–shift–| |––subtract––| Two difficulties: How do you choose from among the 7 possible values for q-j? If the choice is +3 or -3, how do you form 3d?

  36. p-d Plot for Radix-4 SRT Division with Digit Set [-3,3] Fig. 14.12 A p-d plot for radix-4 SRT division with quotient digit set [–3, 3].

  37. Radix-4 SRT Divider with the Digit Set {-2, -1, 0, 1, 2} Radix-4 fractional division with left shifts and q–j [–2, 2] s(j) = 4s(j–1)– q–jd with s(0) = z and s(k) = 4ks |–shift–| |––subtract––| Fig. 14.13 New versus shifted old partial remainder in radix-4 division with q–j in [–2, 2]. For this restriction to be feasible, we must have: s [-hd, hd) for some h < 1, and 4hd – 2dhd This yields h 2/3 (choose h = 2/3 to minimize the restriction)

  38. p-d Plot for Radix-4 SRT Division with Digit Set [-2,2] Fig. 14.14 A p-d plot for radix-4 SRT division with quotient digit set [–2, 2].

  39. Radix r Divider Process to derive the details: Radix r Digit set [–, ] for q–j Number of bits of p (v and u) and d to be inspected Quotient digit selection unit (table or logic) Multiple generation/selection scheme Conversion of redundant q to 2’s complement Fig. 14.15 Block diagram of radix-r divider with partial remainder in stored-carry form.

  40. Multiply/Divide Unit

  41. Multiply-Divide Unit The control unit proceeds through necessary steps for multiplication or division (including using the appropriate shift direction) The slight speed penalty owing to a more complex control unit is insignificant Fig. 15.9 Sequential radix-2 multiply/divide unit.

More Related