Forum Discussion
Altera_Forum
Honored Contributor
15 years agoThere are certainly many applications where fixed-point arithmetic is appropriate, it will almost always be faster than using floating point.
Care does need to be taken to ensure the values don't overflow, and that the correct shifts are applied in all the required places. Multiplying two fixed point numbers together requires the 'high' 32bits of the product of two values (actually you'll typically need 32bit that cross the word boundary). This might be problematic as Altera only provide the mulx instructions for the fpga's with onboard DSP functionality, they don't let you throw fpga real estate at the problem (a 32x32 multiply can be done with 1024 3bit->2bit adders with a ripple latency of 64 adders). Even with the mulx instructions, extracting the relevant bits may be worthy of a custom instruction - especially if your implied decimal point is always in the same place.