0

I am building a divider for my MIPS processor ALU for integer division, and also in FPU for single precision floating point division purpose. I have searched lots of algorithms and wanted to find a good solution.

Since the design is implemented in FPGA, and Altera DE2 is the board I am going to use. Its has many embedded multipliers. Therefore, I think Newton-Raphson method is quite good for my design, the algorithm only need multiplier and adder.

As a Chinese, my English is not very good. After a long time pain of reading the Newton-Raphson paper on Google, I only got results:

if Q=a/b => Q=a * 1/b

and the approximately result Xi+1 = Xi(2 - bXi )

From now, it looks like very clearly, we only need do two multiplications and one subtraction to get a X. What I didn't got from those paper are(Maybe they already on the paper, in some sort of complex equations. As I said my English is bad and that just hard for me to understand those high level paper):

1: How many iterations in one division I need to get a 32-bit integer and 32-bit IEEE754 floating point?

2: What is the initial X? I have searched Newton-Raphson lookup table on Google, but I can't find any good information.

3: What is the "FMA"? I mean in term of logic circuit schematic.

If some give me a floating point division tutorial, It will be very grateful.

Shuaiyu Jiang
  • 239
  • 1
  • 3
  • 15
  • Where does "FAM" occur? Is it "FMA" (= fused multiply-add) by any chance? As for tutorials, have you tried a search engine to find relevant literature. For example, there is [this paper by Altera](https://www.altera.com/content/dam/altera-www/global/en_US/pdfs/technology/dsp/floating-point/floating-point-division-for-dsp-fpga.pdf) for implementing floating-point division in Altera FPGAs. Often, lookup tables are used to generate an initial approximation for the Newton-Raphson iteration of the reciprocal. A cubic polynomial can also be used. – njuffa Jul 31 '15 at 17:54
  • Yeah, this was my type error. Sorry – Shuaiyu Jiang Jul 31 '15 at 17:59
  • In [this answer](http://stackoverflow.com/a/9049376/780717) I provided a worked example that shows how to generate starting approximation for the reciprocal either by table lookup or polynomial approximation; maybe this can help with devising your own solution. – njuffa Jul 31 '15 at 18:00
  • An FMA is a fused operation `fma(a,b,c)` that first computes the full, unrounded, untruncated product `a*b`, then adds `c` to the product, and finally performs a single rounding at the end. This is a very powerful tool in creating correctly rounded division and square root. Wikipedia gives the basics, a literature search (e.g. via Google Scholar) should turn up relevant papers on how this can be used to implement division. – njuffa Jul 31 '15 at 18:05
  • @njuffa So how many iterations I need to resolve a 23-bits division mantissa? – Shuaiyu Jiang Aug 01 '15 at 13:07
  • If you consult easily available sources (even Wikipedia will do as a starting point) you will find that the Newton Raphson iteration for the reciprocal has quadratic convergence, meaning the number of "good bits" will double with each iteration. If you take a look at the answer I pointed to earlier, you will find that there is also a straightforward iteration for the reciprocal with cubic convergence, which triples the number of "good bits" per iteration. – njuffa Aug 01 '15 at 15:13

0 Answers0