FPGA Intellectual Property
PCI Express*, Networking and Connectivity, Memory Interfaces, DSP IP, and Video IP
6355 Discussions

ALTFP_SINCOS - cosine mode

Altera_Forum
Honored Contributor II
1,041 Views

I'm running Quartus 11.0sp1 

 

I think I found an error for the ALTFP_SINCOS megafunction in cosine mode. 

 

For negative inputs the result comes out with the wrong sign. 

 

Example: cos(-0.1) = -0.995. 

 

Since cosine is an even function i.e., cos(x) = cos(-x) it is not that hard to workaround this problem.  

 

 

I have a question about the workaround/fix (solution id: rd12212011_626) for the ALTFP_SINCOS megafunction in sine mode. 

 

To workaround this, change the <altfp_sincos_variant_file_name>.vhd file, line 22850 as follows: 

Change from: 

wire_mantissanorm_add_datab <= ( "0000000000000000000000" & mantissanormnode_w(12)); 

Change to: 

wire_mantissanorm_add_datab <= ( "0000000000000000000000" & mantissanormnode_w(11)); 

 

Am I supposed to make the same change in cosine mode? 

 

 

0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
267 Views

How do you get 0.1 into ALTFP_SINCOS?  

I try it with declaration  

real rho = 0.1; 

But ALTFP_SINCOS cannot accept with real number. 

Thanks for your reading, waiting for your reply!
0 Kudos
Reply