-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Division/sqrt algorithm #23
Comments
There are two. DivSqrtRecF64 uses a quadratically convergent iterative algorithm, using a pre-multiplication to get a 10-ish-bit initial approximation. DivSqrtRecFN_small uses a straightforward one-bit-at-a-time algorithm. |
Then how can I choose which one to use? Which performs better? |
It's too dependent on your application for me to provide an answer. The first option has latency of 25-ish cycles and throughput of 1/3 operations per cycle, but the area cost is high and the clock rate might be limited. The second option has latency of S-ish cycles (where S is the width of the significand) and has throughput of 1/S operations per cycle, but the area cost is low and it can run at higher clock rate. |
DivSqrtRecFN_small doesn't use SRT; it's just one bit at a time. |
Does DivSqrtRecF64 use algorithm of Goldschmidt or Newton-Raphson? @aswaterman |
Hi, I want to generate the Verilog of the division. Could you please tell me how to generate Verilog from hardfloat files? Thank you so much. |
The original Verilog code is still available here: http://www.jhauser.us/arithmetic/HardFloat.html |
FYI. I had a bare configurable SRT in sequencer/arithmetic. I'll find some time to PR hardfloat this year. |
Which algorithm does hardfloat use for division and square root?
The text was updated successfully, but these errors were encountered: