From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

fixed point integers and memory/performance

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?

0 Kudos
Message 1 of 3
(2,076 Views)

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 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 3
(2,073 Views)

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. 

0 Kudos
Message 3 of 3
(2,069 Views)