08-24-2012 09:44 AM - edited 08-24-2012 09:47 AM
I need to use 12 bit integers, and started implementing Fixed Point conversion of U16 numbers to U12. My question is regarding performance and memory allocation. Does a U16 and Fixed Point U12 take up the same amount of bits (16 bits), hence no difference in performance (computations, math functions, etc)?
Also, do I get a performance hit when converting from U16 to a fixed point U12?
08-24-2012 09:50 AM
From the LV help:
Note To represent a rational number using the fixed-point data type, the denominator of the rational number must be reducible to a power of 2, because the binary number system is a base-2 number system. |
Computer architecture is nowadays as such, that only data 2^n can be handled. Infact, many arithmetic logical units (ALU) are optimized for certain numeric representations. So it is possible (depending on the system you are working) that handling 32bit numbers outperform 16bit numbers!
hope this helps,
Norbert
08-24-2012 10:01 AM
Hmm... interesting. Well, the only reason I do the conversion is to quickly cap any values greater than 4095. I am fine with 16bits representation.