Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Altera_Forum
Honored Contributor I
803 Views

ALTFP_SINCOS - cosine mode

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 I
29 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!
Reply