Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

Math Function Accelerate

Altera_Forum
Honored Contributor II
1,147 Views

Hi, 

 

Anyone knows how to accelerate the Nios Math Functions such as Sine function other than using floating point custom instruction? 

 

Thanks, 

Caridee 

0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
415 Views

For things like that I normally inspect the library code to see if it's possible to offload into hardware. I think the way newlib computes sine and cosine is through lookup tables. There are other ways but I forget the math behind them, some use the Cordic algorithm for computing sine and cosine. Also if you only need a finite number of sine results a lookup table would probably work best. So if you had this: y = sin(a); and you know that you only have a finite input range for the variable 'a' you can just turn that into a lookup table. If you are familar with FFT and other similar algorithms that's what most people use.

0 Kudos
Reply