4.1. Finite-Precision Arithmetic Effects
In addition to the error of the Chebyshev approximation, there are errors due to quantization effects, multiplier/squarer rounding and rounding of the final addition that affect the accuracy of the interpolator output.
Each coefficient is quantized to bits using the round-to-nearest approach and stored in a lookup table. The least-significant bit of each coefficient has a weight of , where is the number of fractional bits in coefficient . The difference between a quantized coefficient and its infinite-precision value is defined as , where .
In order to prevent excessive intermediate word lengths, multiplier and squarer outputs are rounded. When standard multipliers are used, rounding is accomplished by adding a “1” to the column immediately to the right of the rounding point, then truncating the k least-significant bits at the output. Recall that k is the number of columns in the multiplication matrix that are formed and added, but discarded in the final result. The maximum rounding error, , is ulps, where 1 ulp is the weight of the least-significant bit output by the multiplier or squarer.
4.2. Linear Interpolator
Figure 4 shows the block diagram of a linear interpolator that computes Equation (
2).
is used to select coefficients
and
from a lookup table. Multiplier 1 computes
, which is then added to
to produce the output. The multiplier output can be kept in carry-save form or a multiply-accumulate (MAC) unit may be used to reduce the overall area and delay of the interpolator.
Figure 4.
Linear interpolator block diagram.
Figure 4.
Linear interpolator block diagram.
Table 3 gives the error budget for the initial linear-interpolator design. As described earlier, the maximum allowable error for the interpolator is defined to be
, which is selected as a design parameter. For the Chebyshev approximation,
m is selected to limit the approximation error to 1/4 of the total error. The total error budget is slightly more than the maximum allowable error,
. However, parameters are selected for each source of error, such that the maximum error is less than or equal to the budget amount. Therefore, it is unlikely that each source of error would be at its maximum value at the same time, so these budget values have been found to work for most designs. When these values result in an initial design that does not meet the error specification, one or more of the design parameters are tightened to bring the design into compliance.
Table 3.
Error budget for linear interpolators.
Table 3.
Error budget for linear interpolators.
Source of Error | Error Budget |
---|
Absolute | Fraction |
---|
Chebyshev approximation | | |
Coefficient quantization ( each) | | |
Multiplier rounding | | |
Rounding at interpolator output | | |
Total | | |
Errors in the output due to the quantization of
and
are
and
, respectively. Since
contributes directly to the output,
, so:
is multiplied by
, which has a maximum value less than
, so:
The error budget for quantization of each coefficient is 1/8 of the total error. Thus, the coefficient length is determined by setting
and solving for
, so:
and:
Section 5 describes how these lengths are then reduced to the minimum precision that maintains the desired accuracy of the interpolator. In addition to the fractional bits, a sign bit is needed, so:
If additional bits to the left of the binary point are required (e.g., if any value of is greater than or equal to one), these values are incremented accordingly. Likewise, if some of the most-significant fractional bits are always constant, these values are decremented accordingly. For example, if all values of are less than 0.25, the two most-significant fractional bits are always zero and do not need to be stored in the coefficient table or input to the multiplier.
In addition to quantization errors, rounding the multiplier output introduces a rounding error,
, at the interpolator output. The least-significant-bit (LSB) weight of
is
, and the LSB weight of
is
, so the LSB weight of a full-precision product would be
. Since
r columns of partial products are not formed and
k output bits are discarded, the LSB weight of the multiplier output is
, so:
where
and
are
k and
r for the multiplier.
The initial design for linear interpolation uses a standard multiplier. The error budget for multiplier rounding is 1/16 of the total error, so
is chosen by setting
and solving for
.
For a standard multiplier, all columns of partial products are formed, so
. Substituting Equation (
39) for
gives:
The equations for finding the initial design parameters for linear interpolators are summarized in
Table 4.
Table 4.
Initial design parameters for linear interpolators.
Table 4.
Initial design parameters for linear interpolators.
Design Parameter | Initial Value | Description |
---|
| | Length of coefficient , assuming |
| | Length of coefficient , assuming |
| | Multiplier 1, number of columns formed, but discarded in the final result |
4.3. Quadratic Interpolator
Figure 5 shows the block diagram of a quadratic interpolator that computes Equation (
3).
is used to select coefficients
,
and
from a lookup table. A specialized squarer computes
. Multiplier 1 computes
, and Multiplier 2 computes
, both of which are then added to
to produce the output. As with the linear interpolator, the multiplier outputs can be kept in carry-save form.
and
for a quadratic interpolator are the same as for a linear interpolator, given by Equations (
36) and (
37).
is multiplied by the squarer output, which has a maximum value less than
, so:
Figure 5.
Quadratic interpolator block diagram.
Figure 5.
Quadratic interpolator block diagram.
Table 5 gives the error budget for the initial quadratic-interpolator design. The error budget for quantization of each coefficient is 1/16 of the total error, so the coefficient length is determined by setting
equal to
and solving for
, giving:
and:
Assuming a sign bit in addition to the fractional bits,
As noted above, these values are incremented accordingly if additional bits to the left of the binary point are required, or decremented if all values of are less than 0.5.
Table 5.
Error budget for quadratic interpolators.
Table 5.
Error budget for quadratic interpolators.
Source of Error | Error Budget |
---|
Absolute | Fraction |
---|
Chebyshev approximation | | |
Coefficient quantization ( each) | | |
Truncation of squarer input () | | |
Multiplier and squarer rounding ( each) | | |
Rounding at interpolator output | | |
Total | | |
Analysis shows that for some configurations,
, can be truncated at the input to the squarer to reduce the size of the squarer. Assume that
t least-significant bits of
are truncated, such that
, where
is the truncated version of
. The squarer output is then
, rather than
, resulting in a squarer output error of
. Noting that
,
and
is negligible, the magnitude of the squarer output error is less than
. This error is then multiplied by
, so the error at the interpolator output due to
is:
assuming all values of
are less than or equal to one. The error budget for truncation of the squarer input is 1/16 of the total error, so
is set equal to
to find the maximum value for
t, which gives:
If any value of is larger than one, or if all values of are less than 0.5, varies accordingly, which affects the calculation for t. For every additional bit required to represent , t decreases by one. If all values of are less than 0.5, then one or more of the most-significant fractional bits are always zero. For each of those bits, t can be increased by one. For example, if all values of are less than 0.25, two of the most-significant fractional bits are always zero, so t can be increased by two. If , cannot be truncated.
As with the linear interpolator, k is set for the multipliers and the squarer to limit the rounding error. The error budget for rounding is 1/32 of the total error for each unit, so is set equal to , and the equation is solved for k.
The LSB weight of the Multiplier 1 output is
, so:
Setting this equal to
and solving for
gives:
Standard multipliers are used for the initial design, so
. Substituting Equation (
47) for
gives:
The LSB weight of the squarer output is
, so:
where
and
are
k and
r for the squarer. The squarer output is multiplied by
, which is assumed to be less than or equal to one, so the rounding error for the squarer is set equal to
to find
:
A standard squarer is used for the initial design, so
, so:
If any values of are greater than 1.0, is decreased accordingly, and if all values of are less than 0.5, is increased accordingly.
The LSB weight of the Multiplier 2 output equals the LSB weight of
multiplied by the LSB weight of the squarer output, which is
, so:
Setting the maximum rounding error equal to
and solving for
gives:
Substituting Equation (
48) for
gives:
Standard multipliers and squarers are used for the initial design, so
and
. Substituting Equation (
58) for
gives:
Because is subtracted, the range of values for affects the calculation. If any values of are greater than 1.0, is increased accordingly, and if all values of are less than 0.5, is decreased accordingly.
The equations for finding the initial design parameters for quadratic interpolators are summarized in
Table 6.
Table 6.
Initial design parameters for quadratic interpolators.
Table 6.
Initial design parameters for quadratic interpolators.
Design Parameter | Initial Value | Description |
---|
| | Length of coefficient , assuming |
| | Length of coefficient , assuming |
| | Length of coefficient , assuming |
| | Multiplier 1, number of columns formed, but discarded in the final result |
| | Multiplier 2, number of columns formed, but discarded in the final result |
| | Squarer, number of columns formed, but discarded in the final result |
t | | Number of bits in that are not input to the squarer |