Forum Discussion
Altera_Forum
Honored Contributor
12 years ago --- Quote Start --- well just a clocked process will do.
process(clk)
begin
if rising_edge(clk) then
if clear = '1' then
sum <= accum;
accum <= (others => '0');
else
accum <= accum +distance;
end if;
end if;
end process;
assuming distance is an incoming stream of samples, one per clock period. you control the clear signal using a counter for your samples. --- Quote End --- sorry kaz . i didn't undersatand that .if you remember that distance is output ,i make a signal instead of output but it every clk increment the accum. could you plz illustrate.