Forum Discussion
Altera_Forum
Honored Contributor
13 years ago --- Quote Start --- @kaz, I have 2 questions related to the continuous averaging. First question is related to increasing the number of stages. I want to increase the number of stages from 32 to 1000. I am doing this for stabilizing the ADC current values. Do I have to modify the signal lengths in the following way: --- Quote End --- My final conclusion for 1024 average use equation suggested by dsl and modified as follows: y(n) = y(n-1) - y(n-1)/1024 + x(n)/1024 i.e. clocked process sum = sum - sum(20 downto 10) + data_in(11 downto 10); -- use more width for sum if necessary to avoid overflow. end process; only two bits of data_in are used so you may lose resolution but it might be just ok.