- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am looking to convert a 16bit number(X) to another 16 bit number(Y). X is a count coming from a Tach output on a Fan. Y is the fan's corresponding RPM. (note: this is a inverse relationship)
The relationship is Y = 60 / (X*1.706e-6) To keep it fixed point so far the best I have come up with is 2 divides: First I = X / 58 (I is intermedite value) then take 606000 / I to get Y. X ranges from about 5858 to 30000. I am worried about the real estate of 2 divides, since I will need 8 channels of this (8x2=16 divides) on my cyclone II. Any help improving this calculation? Thanks!Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How often do you need a result? If you need this result several million times a second, yes, I'd worry about the area. If it's once per millisecond, then don't use the LPM_DIVIDE, but write a tail divider that gives a result once per 32 clock cycles or so.
Best regards, Ben- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
if the clock rate is much higher than the sample rate, you can TDM or channelize your arithmetic to save resources
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I you want exactly a calculation of the given expression, I would calculate 35294118/X, using an serial divider.
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