Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20705 Discussions

Help with Efficient Conversion?

Altera_Forum
Honored Contributor II
942 Views

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!
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
230 Views

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
0 Kudos
Altera_Forum
Honored Contributor II
230 Views

if the clock rate is much higher than the sample rate, you can TDM or channelize your arithmetic to save resources

0 Kudos
Altera_Forum
Honored Contributor II
230 Views

I you want exactly a calculation of the given expression, I would calculate 35294118/X, using an serial divider.

0 Kudos
Reply