Q:

How to measure distance between two data in vhdl

Calculate the distance between the position of each element in a list1 and the position of the same element in list2 then find the normalized distance in vhdl
First, we will make mem1 (consist of addresses for every data input) i.e address from 1,2,3,4.... to end of the mem1 data input,ok
mem2 (consist of addresses for every data input ) i.e address from 1,2,3,4.... t0 end of the mem2 data input,ok
Check if any of the data input from mem1 = any data input from mem2 .
I.e. The position of each element in mem1 and the position of the same element in mem2
So the address to the same element will be different in the two mem
The address difference will be the distance measure.
I.e searching for similarity, the compute the distance between list1 and list2
How I can do this in vhdl code???
Any help please???

A:

Your approach sounds logical.  I would design a single entity that instantiated a piece of memory.  The input would be the data that you are looking for.  The output would be the location of the data, and a signal indicating if the data was found or not.  It would take a number of clock cycles to read out all of the data from the memory.  The number of clock cycles would be equal to the depth of the memory.  So if you have 10 data words in your memory, it would take 10 clocks to read through all of the words.
There are corner cases that you should consider... what if the data word is in the memory twice?  Is the data stored in the memory in sequential order?  
Once you've figured all of this out, instantiate two of these components inside a higher level file.  This file does the calculation of the distance between the two data locations.  
This is just how I would tackle it conceptually.  Good luck.

