To convert, a matlab code to HDL (VHDL), Matlab HDL Coder can be used. There are some signal processing examples of hdl coder given on mathwokrs website but they are not easy to understand. Does any one know any link(s) where HDL coder examples can be found .
The problem is I am trying to convert below Matlab code to VHDL but facing troubles.
Any advice/help please?
function y = fcn(n,y1,y2)
n=10;
x1c=zeros(2*n-1,1);
for i=1:2*n-1
if(i>n)
j1=1;
k1=2*n-i;
j2=i-n+1;
k2=n;
else
j1=n-i+1;
k1=n;
j2=1;
k2=i;
end
x1c(i)=sum((y1(j1:k1)).*y2(j2:k2));
end
x1c=flipud(x1c).';
y=x1c;
Where y1 and y2 vectors of same length and n is size of y1.