comparison with embedded processor

Aug 23, 2007 5 Replies

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


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

Cheers, Jon

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

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

-- mmihai

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

-- 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.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required