Use division for fixed-point net slope computation
How net slope computations are performed when a change of fixed-point slope is not a power of two
Model Configuration Pane: Math and Data Types
Description
The Use division for fixed-point net slope computation parameter specifies whether the Fixed-Point Designer™ software performs net scaling computation using division to handle net scaling when simplicity and accuracy conditions are met.
Dependencies
This parameter requires a Fixed-Point Designer license.
Settings
Off
(default) | On
| Use division for reciprocals of integers only
Off
Performs net scaling computation using integer multiplication followed by shifts.
On
Performs net scaling computation using a rational approximation of the net scaling. This results in integer division, multiplication, and addition when simplicity and accuracy conditions are met.
Use division for reciprocals of integers only
Performs net slope computation using division when the net slope can be represented by the reciprocal of an integer and simplicity and accuracy conditions are met.
Tips
This optimization affects both simulation and code generation.
When a change of fixed-point slope is not a power of two, net scaling computation is necessary. Normally, net scaling computation uses an integer multiplication followed by shifts. Enabling this optimization replaces the multiplication and shifts with an integer division, multiplication, and addition under certain simplicity and accuracy conditions.
Performing net scaling computation using division is not always more efficient than using multiplication followed by shifts. Ensure that the target hardware supports efficient division.
To ensure that this optimization occurs:
Set the word length of the block so that the software can perform division using the
long
data type of the target hardware. That setting avoids use of multiword operations.Set the Signed integer division rounds to configuration parameter on the Hardware Implementation pane to
Zero
orFloor
. The optimization does not occur if you set this parameter toUndefined
.Set the Integer rounding mode parameter of the block to
Simplest
or to the value of the Signed integer division rounds to configuration parameter setting on the Hardware Implementation pane.
The following table summarizes how this parameter effects different fixed-point operations.
Operation | Use division for fixed-point net slope computation | Use division for fixed-point net slope computation |
---|---|---|
Multiplication | Fixed-point multiplication operations with non-power-of-2 slopes and/or non-zero bias have improved representation. | Fixed-point multiplication operations follow legacy behavior. |
Division | Fixed-point division operations with non-power-of-2 slopes and/or non-zero bias have improved representation. | |
Cast | Fixed-point cast operations with non-power-of-2 slopes and/or non-zero bias have improved representation. | Fixed-point cast operations follow legacy behavior. |
Recommended Settings
Application | Setting |
---|---|
Debugging | No impact |
Traceability | No impact |
Efficiency | On (when target hardware supports efficient division) Off (otherwise) |
Safety precaution | No impact |
Programmatic Use
Parameter: UseDivisionForNetSlopeComputation |
Value: 'off' | 'on' | 'UseDivisionForReciprocalsOfIntegersOnly' |
Default: 'off' |
Version History
Introduced in R2014b
See Also
Topics
- Net Slope Computation (Fixed-Point Designer)
- Model Configuration Parameters: Code Generation Optimization (Simulink Coder)