Forum Discussion
Altera_Forum
Honored Contributor
12 years agoHow to measure distance between two data
really i have a problem for measure the distance between these data as the following.could i can make it in vhdl from enter this data to vhdl to measure distance between them. d(s1,s2)=(1+1+0+1+1)...
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.