We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for
Did you mean:
Visitor
276 Views
Registered: ‎03-11-2011

## Virtex 7 ARCTAN CORDIC Wrong Results

I am doing a behaviour simulation of the CORDIC Arc Tan function in order to compare it to the top level C code simulations and for 2 of the 15 values input into the simulation the arctan outputs a value that is off by quite a bit.    Attached is the simulation but when the inputs values of real/Imaginary are as follows the answer is wrong.  The arctan input and outputs are 16 bit values.  Vivado 2019.2 CORDIC 6.0

6th value in the sim IN=5885/-27649   OUT= -11073   should be -11150

9th value in the sim IN=-26325/17177   OUT= 17888 should be 20999

ALl the other ARCTAN values are exact.

I tried regenerating the core with more iterations and it didnt change these results.

4 Replies
Teacher
260 Views
Registered: ‎07-09-2009

## Re: Virtex 7 ARCTAN CORDIC Wrong Results

Interesting,

I dont knwo the answer, and I hope some one can .

Thoughts .

a) is it the c code thats wrong ?

b) wonder if the core is saturating, what happens with more than 16 bits,

c)  with a caculator, what should the answer be ?  could it be there is great slope at that point on the graph ?

Highlighted
Visitor
246 Views
Registered: ‎03-11-2011

## Re: Virtex 7 ARCTAN CORDIC Wrong Results

a) is it the c code thats wrong ?  The C-Code matches Excel simulation

b) wonder if the core is saturating, what happens with more than 16 bits,

I thought the same thing but the value is well within the 16 bit range, even less than other examples in the same simulation.  But if I cut the values in half it gives the correct output.  The output of an arc tan has to do with the ration of one input to the other.

c)  with a caculator, what should the answer be ?  could it be there is great slope at that point on the graph ?

The calc gives the same answer as Exel and the C code simulation.

We had used a 24 bit arc tan previously and did not have this problem.   I am going to play around with the bit size on the input.   The 24 bit version too way to many gates so we had to cut that down.

Visitor
240 Views
Registered: ‎03-11-2011

## Re: Virtex 7 ARCTAN CORDIC Wrong Results

If I extend the inputs of the arctan to 17 bit values (extending the bits one bit up) for the arc tan then the outputs are perfect.   So this has something to do with the combined values of the inputs being past a certain point.

thanks for you repsonse it did make me think.

Teacher
175 Views
Registered: ‎07-09-2009

## Re: Virtex 7 ARCTAN CORDIC Wrong Results

sounds like a rounding problem there , quiet a bad one,
Wonder if xilinx will fix it,
Im guessing that going for 17 bits, and rounding in the final output is going to be a work around,
Interesting, personally , I'm making a note for the future,