The full precision output width can be defined as the input data width plus the bit growth due to the application of the filter coefficients. Bit growth from the original sample width occurs as a result of the many multiplications and additions that form the basic function of the filter. Therefore, the accumulator result width is significantly larger than the original input sample width. Limiting the accumulator width is desirable to save resources, both in the filter output path (such as output buffer memory, if present) and in any subsequent blocks in the signal processing chain. The worst case bit growth can be obtained by adding the coefficient width to the base 2 logarithm of the number of non-zero multiplications required (rounded up); however, this does not take into account the actual coefficient values. This Equation demonstrates this calculation, where B is the calculated bit growth, N is the number for filter coefficients and C w is the coefficient width.
Taking the base 2 logarithm of the sum of the absolute value of all filter coefficients reveals the true maximum bit growth for a fixed coefficient filter, and this can be used to limit the required accumulator width. This Equation demonstrates this calculation, where B is the calculated bit growth, N is the number for filter coefficients, and a n is n th filter coefficient.
The FIR Compiler automatically calculates the bit growth based on the actual coefficient values. For reloadable filters the worst case bit growth is used.
This Equation gives the cores full precision output width, where B is the calculated bit growth (given by This Equation or This Equation ), D w is the data width and A w is the full precision output width.
The Coefficient (and Data) fractional width does not affect the output width calculation. The core determines the output width without considering fractional bits. The core determines the full precision output as previously described and then determines the output fractional width by summing the data and coefficient fractional bit width. This value is then reduced by any output rounding. This Equation demonstrates this calculation, where O w = output width, O fw =output fractional width, D fw =data fractional width, C fw =coefficient fractional width and A w =full precision output width.