comparison with embedded processor

Hi all,

I need to implement this code (below) with a embedded processor FPGA. Do you have any information to help me in the choice of this FPGA (performance) Altera // niosII, Xilinx // microblaze Lattice // mico32 For information, I'm trying this exemple in a Nios II (STR10 Kit) at

120MHHz, and the time for this "for functions" is around 30 seconds... Regards, bhb

----------------------------------------- my code :

double a ; double b ; double c ;

...

for (j = 1; j

Reply to
bhb
Loading thread data ...

MicroBlaze has h/w floating point, but I think it may only be single precision.

Cheers, Jon

Reply to
Jon Beniston

You can improve the speed of this code by a factor of 1 million:

result=1000*1000*a+1000*b+c

but I assume you want to use the intermediate "result" results, too :-) Then you should think about converting the doubles to fixed point numbers, if possible, and implementing it in VHDL, maybe triggered from a Nios program with a custom instruction or simply a port.

--
Frank Buss, fb@frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de
Reply to
Frank Buss

Yes, you can, but your reduction of the sum of sum it is not correct ... Try again :-)

-- mmihai

Reply to
mmihai

My bad, I've read result+=...

-- mmihai

Reply to
mmihai

Actually, even if it was +=, as long as the boundaries are fixed, the two loops can be reduced by pre-calculating the sums of j and k^2...

1) sum of j over 1..1000 = 500500

Rewrite after eliminating the 'j' loop:

2) sum of k^2 over 1..1000 = 333833500

Rewrite after eliminating the 'k' loop:

There you are, the result of even += through the two loops without any loops.

Reply to
Daniel S.

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.