Forum Discussion
Altera_Forum
Honored Contributor
12 years agoOk you are getting there. Your read can be internal rather than inputs.
I suggest state machine of s0,s1,s2 s0: read ram1(address at 0) into ram1_data register, one clock,move to s1 s1:read ram2(address 0~till equality) into ram2 register, several clocks, if equality found between ram1/ram2 data set ram2 address to zero, output (address difference), move to s2 s2:set ram1 address to 1(increment),one clock, move to s0 start again for ram1 address 1 and so on. by doing that you will output a stream of distance. Your design is no trivial and is good for practice.