- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
I'm designing a system using simple LPM divider, it works fine below 64 bits number, but when the number is larger than 64 bits, it gives me an error stating that LPM cannot support more than 64 bits. My system requires at least 128-bit number, I wonder how can this be done. Thanks and Regards, ty6Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can write your own function using a serial approach for 'long divide'. It will take up to 128 clocks (and a few) to calculate the result. It will use reasonably few rersources compared to a direct combinatorial approach.
If you need speed that you have to pipeline every stage which will be a lot more work.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can use Newton method for computation of 1/a and then, use it for division computation.
In case if you computed x=1/a with 64 bit precision, you can improve it to 128 bit precision with simple formula: y=2*x-x*x*a. You can generally start with 4 bit 1/a approximation and apply this formula 5 times, then you can implement everything from the scratch without megawizards on integer arithmetic (do not forget to scale your intermediate data!!) and then convert to floating point. Sure you can make it fast enough with pipelining. I did it once for my Stratix III project and achieve about 250 MHz, probably it can be faster but it was enough for me.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page