# Word-length optimization of a fixed point chain of multipliers

Let's suppose a chain of 6 multipliers: $b = a_1*a_2*a_3*a_4*a_5*a_6*a_7$, where $b$ is the output, and $a_i$ the inputs with 16 bits. How can I optimize the word lengths of the output of each multiplier in order to minimize the fixed point error against a full precision implementation? Let's also suppose that the output $b$ shall be some reasonable word length, for example 35 bits.

-
Are you looking for a solution for general $a_i$, or for a specific case? It's going to depend upon the values of the coefficients, as well as their relative order. If the coefficients are known ahead of time, could you precalculate their product to avoid having to do all of the multiplication in fixed-point? – Jason R Jan 19 '13 at 14:17
I think you need to put some constraints on the values of a1...a7 before you can try to do any kind of optimization. In general you are going to need to implement some kind of multiply-accumulator that has better than 16 bit resolution. – user2718 Jan 22 '13 at 18:01
I am looking for a solution for general ai. The order is: first (a1*a2), the result is multiplied by a3: (a1*a2)*a3, and so on. The coefficients are not known ahead of time, so no precalculation is available. – eduardocreta Jan 22 '13 at 22:10
By definition you cannot optimize for the general case. If you want to be able to handle any situation, the multipliers will be huge. – Jim Clay Jan 23 '13 at 14:15