- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
:oops:
Hi, In my architecture I need to do the following formula: " ("conv_integer (byte) * 10000)/127 + 10000 I'm working with 10MHz clock. The code Fmax is: 14.5MHz ("TimeQueast" is all blue after clock constrain to 10MHz) Is it going to be enough for the calculation to be quick for using the date immediately inside the Process or must I use pipeline stages and divider IP block instead of "/" operator? in simulation is works just fine. Thanks, IdanLink Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- :oops: Hi, In my architecture I need to do the following formula: " ("conv_integer (byte) * 10000)/127 + 10000 I'm working with 10MHz clock. The code Fmax is: 14.5MHz ("TimeQueast" is all blue after clock constrain to 10MHz) Is it going to be enough for the calculation to be quick for using the date immediately inside the Process or must I use pipeline stages and divider IP block instead of "/" operator? in simulation is works just fine. Thanks, Idan --- Quote End --- RTL simulation has no knowledge of 'delays' instead of dividing by a number, multiply by a scaled reciprocal of that number. You are almost halfway there your formula
(a * 10000) / 127 + 10000
can be changed to ( a * 79) + 10000
if you want more precision you can scale it up further like e.g. (a * 20157) / 256 + 10000
As the 256 is a power of 2 the compiler will graciously implement a right shift of 8 Result: no divider, less LEs used and maximum speed ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Brilliant!
Thank you very much, I learned something new. Idan :-P
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