I need to design a circuit which accepts n numbers at the input (infinite input) and calculates the average of these numbers as the output. The numbers for the input can only be of values <0,15>.
I need to implement this circuit in VHDL but I cannot find the proper algorithm since I need it to design the logical schema. I understand that I will definitely need a 4bit adder and some registers to store the values. I tried to understand the problem using moving average principle but it just did not work at all.
I need to design a circuit which accepts n numbers at the input (infinite
Share
For input
n+1, with valuex, the average will be equal to(average*n+x)/(n+1)–> … =average + (next - average)/(n+1).From this observation a simple algorithm can be derived: