Posted on 07/12/2002 3:15:33 PM PDT by JameRetief
I wonder if anyone's using Cyrix's patented method for long division? Shortly after the Pentium F-div fiasco, I found myself thinking there must be a way of accellerating division that wasn't so horrendously complicated; I found it, but unfortunately when I did a patent search someone at Cyrix had beat me to it (their method was slightly different, but quite similar).
Essentially, my method takes advantage of the fact that if the first N bits of the divisor are all "1"'s and the next group of N bits from the divident or partial remainder equals x, then the next N bits of the quotient must be either x or x+1; the determination of which is correct may be deferred until the end, if an extra couple bits are kept for each partial quotient ( Example:
123,565,155,653,854,108 123,564¹154¹652²852²107 R ¹953,073 999,123 ) 123,456,789,012,345,678,901,234 122,892,129 564,660,012 563,505,372 1,154,640,345 1,152,987,942 1,652,403,678 1,650,551,196 1,852,482,901 1,850,375,796 2,107,105,234 2,105,152,161 1,953,073This example was worked base-1000. Note that each partial quotient equals the leading part of its partial remainder (for partial quitients over 1,000, the first digit is shown superscripted). The partial quotients need to be summed, and the excess from the "remainder" needs to be added to the least significant digit of the quotient, but these are comparatively minor steps and may be easily parallelized.
BTW, while most divisors won't be of the form "11111xxxxxx" [binary] or "99999xxxx" [decimal], it's easy to compute an approximate reciprocal which, when multiplied by the divisor, will yield one of appropriate form. Multiplying divisor and dividend by the same value will not change the quotient.
Graphics buffers are arranged to match the natural order of rasterization - left to right, top to bottom, and it is the most efficient way to address a bit in a field of arbitrary length.
Disclaimer: Opinions posted on Free Republic are those of the individual posters and do not necessarily represent the opinion of Free Republic or its management. All materials posted herein are protected by copyright law and the exemption for fair use of copyrighted works.