Main Content

Handle Denormals

Specify whether to handle denormal numbers

Since R2020b

Model Configuration Pane: Floating Point


Specify whether you want to handle denormal numbers in your design. Denormal numbers are nonzero numbers that are smaller than the smallest normal number.


To specify this parameter, select Use Floating Point.


Auto (default) | On | Off

Default: Auto


Controls the insertion of additional logic to handle the denormal numbers based on a floating-point data type used in your design. This option inserts a denormal logic if your design uses the half-precision data types. While using single or double data types, denormal logic is not added in your design.


Inserts additional logic to handle the denormal numbers in your design.


Does not add additional logic to handle the denormal numbers in your design. If the input is a denormal value, HDL Coder™ treats the value as zero before performing computation.


To specify the latency strategy:

  1. Create a floating-point target configuration object for Native Floating Point as the floating-point library.

    fpconfig = hdlcoder.createFloatingPointTargetConfig('NativeFloatingPoint');

  2. Specify the HandleDenormals property of the LibrarySettings attribute of the floating-point target configuration object.

    fpconfig.LibrarySettings.HandleDenormals = 'on';

  3. Set the floating-point target configuration on the model and then generate HDL code. This example shows how to set the configuration on the sfir_single model and generate HDL code for the symmetric_fir subsystem:


  • Insertion of an denormal logic in your design provides an ability to handle the denormal numbers with an overhead of increasing hardware resources. Hence, you can enable or disable the Handle Denormals option based on your requirements.

  • For some of the floating-point blocks, HDL Coder generates the code that has denormal logic enabled by default. These blocks are:

    • Add

    • Subtract

    • Data Type Conversion

    These blocks can handle the denormal numbers with minimal impact on the hardware resources. The generated code for these blocks is not affected by Handle Denormals settings.

Recommended Settings

No recommended settings.

Programmatic Use

Parameter: HandleDenormals property of LibrarySettings attribute of hdlcoder.FloatingPointTargetConfig object
Type: character vector
Values: 'Auto' | 'on' | 'off'
Default: 'Auto'

Version History

Introduced in R2020b