Forum Discussion
Altera_Forum
Honored Contributor
12 years agocontinuous averaging using VHDL
I have a question related to VHDL programming. I want to calculate the continuous average. My example code is:
process (clk, reset)
begin
if (reset = '1') then
state<=idle;
out-v...
Altera_Forum
Honored Contributor
12 years ago --- Quote Start --- If n is a power of 2 you don't need a multiply - just some shiftsand two adds --- Quote End --- Yes, in that case we convert: y(n) = a*y(n-1) + (1-a)*x(n) ... two multipliers, one adder ...to y(n) = a*y(n-1) + x(n) -a*x(n) i.e. y(n) = a*(y(n-1) -x(n)) + x(n); ... one multiplier, one subtractor, one adder then (a) can be power of 2 but we get limitations on cutoff point