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 --- regarding you code about register how i can find index in vhdl code. --- Quote End --- The index of register would be the loop
for i in 0 to n-1 loop
for j in 0 to n-1 loop
if s1_shift(i) = s2_shift(j) then
d(i) <= j-i;
end if;
end loop;
end loop;
you will get d(0) ~ d(n-1) as distance then you compute it further you need to get the type conversion right and test the code idea.