FPGA 做算法,真的是让人难受!
iii=0;
while iteration > 0
iii=iii+1;
suma = 0;
sumb = 0;
for i = 1:1:frequencyN
frqth = Vb(i);
denominator = (Vb(i)-primaryIteration)*(Vb(i)-primaryIteration) + FWHM*FWHM;
f(i) = testValue(i)- FWHM*FWHM / denominator ; derf(i)=(-2*gain*FWHM*FWHM*(Vb(i)-primaryIteration)/ (denominator*denominator)); suma = suma + f(i) * derf(i);
sumb = sumb + derf(i) * derf(i) ;
end
step = -suma/sumb;
我的终极目标是 让以上这段迭代代码用FPGA 实现,可是我学了两个礼拜的DSPbuilder 悲催的发现,也不好实现,里面出现了除法!
就这么几行代码,用ARM 很快就搞定了,FPGA怎么这么难呢 没有思路啊 没有思路!!! 大神们支个招吧 不想用嵌入式软核去算,还得增加SDRAM |