Table Of Contents

Converting Floating-Point Data Types to Fixed-Point Using Suggestions

Last Modified: January 11, 2018

When you convert floating-point data types to fixed-point, the Convert to Fixed-Point tab provides fixed-point data type suggestions based on your conversion strategy settings.

Before you convert any data types, you must configure your conversion strategy. Refer to Choosing a Fixed-Point Conversion Strategy for help configuring a conversion strategy.

After you configure your conversion strategy, complete the following steps to convert the floating-point data types on the profiled diagram to fixed-point:

  1. Seed all random number generators throughout your application, including in your testbench.
    1. Seed random number generators, such as Noise Generator (Uniform) or Noise Generator (Gaussian) by wiring a value greater than 0 to the seed input.
    2. Because you cannot seed Random Number nodes, replace any Random Number nodes with a random number generator from the Generation palette category.

    If you do not seed random number generators, the output of the random number generators is different each time you run the testbench, making the comparison of operators within an algorithm across multiple testbench executions misleading.

  2. Run the testbench VI to populate the Type column of the table inside the Convert to Fixed-Point tab with a fixed-point data type suggestion for each object on the diagram based on the strategy settings you specify. The Convert to Fixed-Point tab projects signal-to-noise ratio (SNR), overflow, and underflow values for each data type suggestion.

    You can edit your strategy settings after running the testbench VI to update the table with different suggestions.

  3. Select the objects you want to convert from the table within the Convert to Fixed-Point tab.
  4. Click Convert using suggestion to convert each selected object to the respective fixed-point data type suggestion listed in the table. Notice that the values in the table are now out of date.
  5. Run the testbench VI to calculate the actual SNR, overflow, and underflow values between the first testbench execution and the current testbench execution for each profiled object. The Convert to Fixed-Point tab displays these values in the table.
If the current data types meet your SNR and word length goals, and the fixed-point results sufficiently represent your floating-point results, you can stop the conversion process here. However, if the current data types do not meet your SNR or word length goals, or the fixed-point results do not sufficiently represent your floating-point results, refer to Refining Converted Fixed-Point Data Types for help refining the data types to meet your goals.

Recently Viewed Topics