Using the Smallest Data Type to Optimize FPGA VIs
- Updated2025-03-06
- 1 minute(s) read
Using the Smallest Data Type to Optimize FPGA VIs
Use the smallest data type possible for non-constant values to decrease the size and increase the speed of an FPGA VI. Consider the following guidelines when creating an FPGA VI.
- Numeric functions—Numeric functions coerce all inputs to a largest data type. For example, if you wire a 16-bit and a 32-bit integer to the inputs of the Multiply function, the function coerces the 16-bit integer into a 32-bit integer. If you want to avoid coercion to a larger data type, use the To Fixed-Point function to convert the integer inputs into equivalent fixed-point data types and configure the Multiply function output for the desired fixed-point representation.
- Loop Timer, Tick Count, and Wait VIs—You can use the smallest Size of Internal Counter possible for the FPGA VI.
- While Loop—You can convert the 32-bit iteration terminal output to the smallest data type that still supports the maximum number of iterations the loop executes. You also can avoid using the iteration terminal by using shift registers instead.
- Index Array function—The Index Array function uses a 32-bit integer as the default for the index input. If the array you wire to the array input contains less than 256 elements, you can change the representation of the input from a 32-bit integer to an 8-bit integer.
You also can save FPGA resources by choosing the smallest data type possible for the following block diagram objects:
- Comparison functions
- Wires to Case structures case selectors
- Controls and indicators