Retaining the Precision of DSP48E and DSP48E1 Function Terminals
- Updated2025-09-18
- 3 minute(s) read
To retain numerical precision in a DSP48E or DSP48E1 application, use the Fixed-Point Configuration page of the configuration dialog box to set the integer word lengths of the input and output terminals appropriately. LabVIEW keeps the word lengths of these terminals constant, which means the integer word lengths are the variables you can control.
LabVIEW groups certain function terminals together. These groups must maintain identical fixed point data types. The following table shows the terminals and word length in each group.
| Terminal(s) in Group | Word Length of Terminals |
|---|---|
| a, acin | When Configure for Arithmetic is selected
on the Function page and a multiplier is
used, the word length is 25 in direct mode and 30 in cascade mode. Otherwise, the word length
is 30 with the following exceptions:
|
| acout | 30 |
| b, bcin, bcout | 18 |
| c | 48 |
| p, pcin, pcout | 48 |
| (DSP48E1) d | 25 |
Retaining Precision for the a and b Terminals
NI recommends setting the integer word length of the a and b terminals to meet the following criteria:
- The fractional word length of these terminals, which is the word length minus the integer word length, is greater than or equal to the fractional word length of the data type wired to the terminal.
- The integer word length of the terminal is greater than or equal to the integer word length of the source.
For example, if you wire a <+/–,16,1> data type to the b terminal, that data type has a fractional word length of 15 bits. Because the word length of b is fixed at 18 bits, set the integer word length of b to 3, 2, or 1 bits. These settings satisfy the above criteria: the fractional word length is 15, 16, or 17 bits, and the integer word length of b is greater than or equal to the integer word length of the source.
If the integer word length is less than 1 bit or more than 3 bits, LabVIEW coerces the value to the b terminal, resulting in a loss of precision. A coercion dot appears on the input terminal to alert you to this situation.
Retaining Precision for Multipliers
To retain full precision in a DSP48E or DSP48E1 function configured as a multiplier p = a * b, set the fractional word length of p to the sum of the fractional word lengths of the a and b terminals.
Consider the following example:
- The data type of the source to a is <+/–,16,1>. The fractional word length is 15 bits.
- The data type of the source to b is <+/–,16,2>. The fractional word length is 14 bits.
The sum of the fractional word lengths is 29 bits. In this situation, NI recommends completing the following steps:
- Set a to <+/–,30,15>. This setting matches the 15-bit fractional word length of the source wired to this terminal.
- Set b to <+/–,18,4>. This setting matches the 14-bit fractional word length of the source wired to this terminal.
- Set p to <+/–,48,19>. This setting matches the 29-bit fractional word length of the a and b terminals combined.
Retaining Precision for Accumulators
To retain full precision in a DSP48E or DSP48E1 function configured as an accumulator p = p + c, set the fractional word length of p equal to the fractional word length of c. For example, if the data type of the source to c is <+/–,16,3>, the fractional word length of c is 13 bits. Set p to <+/–,48,35>.