The goal of this section is to summarize in a few words as possible the gigantic complexity of FXP.
Background
- When 2q30 is 1q30?
- Float or integer
- First it was q15
- Then came q14
- Then came 1q15, 1q31, 2q30 etc..
- Then we got lost; 1q31=1q15 but 1q15 ~= 1q15 !!
- Still
List of FXP dialects
- Assembly language on first generation DSPs
- ITU basic operators
- Matlab FI
- Simulink Fixed Point
- System C
- DSP extensions in C
- Proprietary FXP languages from CAD companies
FXP and integer
When translating FP to FXP the common mistake is to think that replacing the float data types with integer data types will suffice. This would be true if the operations were addition or based on addition. But as soon as multiplications are involved this does not work so well and it gets worse with division, transcendental functions, etc...
The reason is (in 99% cases), an FXP is not an integer. It is a fractional number. It can be a pure fractional (less than 1) or partly fractional (for instance in the range +31 to -32 will have 11 bit of fractions, in a 16-bit wide word).
Hence it is well known that an integer 16x16 gives 32bits and a fractional 16x16 gives 31bit ( and a saturated case). Also it is easy to visualize that an integer division and a fractional division will grow in opposite directions.
No comments:
Post a Comment