cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Observer
Observer
6,082 Views
Registered: ‎09-28-2016

CORDIC SINCOS

Hi all experts.

 

I want to use the Cordic IP for finding the sin and cosine values. what is the IP setting to use it? I am using Vivado 2014.3. suppose if I am giving angle in radians of 1.507. how to see the sin and cosine value for this by using cordic IP. 

 

Shashidhar

0 Kudos
5 Replies
Highlighted
Moderator
Moderator
6,076 Views
Registered: ‎09-15-2016

Re: CORDIC SINCOS

Hi @shivanagis,

 

 

The Design Flow Steps is given in page.37 of this document: https://www.xilinx.com/support/documentation/ip_documentation/cordic/v6_0/pg105-cordic.pdf

 

For the functional description and vector rotation equation of the CORDIC algorithm please refer page. 16 and 17 respectively of this document: https://www.xilinx.com/support/documentation/ip_documentation/cordic/v6_0/pg105-cordic.pdf

 

The Fixed-Point CORDIC Algorithm is given here (page 2): https://www.xilinx.com/support/documentation/application_notes/xapp552-cordic-floating-point-operations.pdf

 

Thanks & Regards,
Prathik
-----------------------------------------------------------------------------------------------
Search for documents/answer records related to your device and tool before posting query on forums.
Search related forums and make sure your query is not repeated.

Please mark the post as an answer "Accept as solution" in case it helps to resolve your query.
Helpful answer -> Give Kudos
-----------------------------------------------------------------------------------------------

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
6,061 Views
Registered: ‎08-01-2008

Re: CORDIC SINCOS

When the Sin and Cos functional configuration is selected, the unit vector is rotated by input angle, , using the CORDIC algorithm. This generates the output vector (Cos( ), Sin( )). . See Input/Output Data Representation for more information about CORDIC binary data formats. An optional coarse rotation module is provided to extend the range of input angle, , to the full circle. For this functional configuration, the coarse rotation module is selected by default, but can be manually deselected. See Advanced Configuration Parameters for more information. When this option is not set, inputs must be constrained to lie in the first quadrant, -Pi/4 to + Pi/4. The compensation scaling module is disabled for the Sin and Cos functional configuration as it is internally pre-scaled to compensate for the CORDIC scale factor

 

Sin and Cos The input angle, PHASE_IN, is expressed as a fixed-point twos complement number with an integer width of 3 bits (2QN format). The output vector, (X_OUT, Y_OUT), is expressed as a pair of fixed-point twos complement numbers with an integer width of 2 bits (1QN format). In this example the input/output width is set to 10 bits.

 

PHASE_IN: “0001100100” => 000.1100100 => 0.781

X_OUT: “0010110110” => 00.10110110 => 0.711

Y_OUT: “0010110100” => 00.10110100 => 0.703

Thanks and Regards
Balkrishan
--------------------------------------------------------------------------------------------
Please mark the post as an answer "Accept as solution" in case it helped resolve your query.
Give kudos in case a post in case it guided to the solution.
0 Kudos
Highlighted
Observer
Observer
6,049 Views
Registered: ‎09-28-2016

Re: CORDIC SINCOS

Hello @balkris

 

First of of I am thinking you for reply.

 

Here the output is not in the form of X_OUT and Y_OUT. But its giving only one output of 32-bit. I am giving input as -1.5707="1100110111000000" but output is 11000000000000000000000000000111=c0000007.

 

 

Thanks and regards

Shashidhar 

0 Kudos
Highlighted
Observer
Observer
6,003 Views
Registered: ‎09-28-2016

Re: CORDIC SINCOS

Hello @prathik 

 

Thank you for your valuable reply.

 

I have done according to that cordic algorithm. here I am giving input as 1.57 radian equivalent 32-bit in hexadecimal but output is 64-bit and i am not able to find cos and sine value. Please help me.

 

 

Thanks and regards 

Shashidhar

0 Kudos
Highlighted
Scholar
Scholar
5,932 Views
Registered: ‎09-16-2009

Re: CORDIC SINCOS

 

Preliminaries:

1.  I know nothing about the Xilinx Cordic module - never used it - so take all this with a grain of salt

2.  I like to use the Fixed Point notation given here:Fixed-Point Arithmetic: An Introduction, by Randy Yates

 

The answer you get look right to me. 

IN = -1.5707 - you're looking at -PI/2 as your input.  In fixed point format of A( 1, 14 ) the input of "0xcdc0" looks reasonable to me (I didn't do the conversion manually, but it looks about right).

 

The returned value, looks to me to be in fixed point format of A( 1, 30 ).  The value returned value of  0xc000_0007 is right around -1.0 when expressed as a real (some rounding errors can be expected).  That would be the SIN( IN ), and looks correct to me.

 

Does the COS output return zero ( or within a few LSBs of zero )?

 

Regards,

Mark

 

0 Kudos