Sign In

Don't have a Xilinx account yet?

  • Choose to receive important news and product information
  • Gain access to special content
  • Personalize your web experience on Xilinx.com

Create Account

Username

Password

Forgot your password?
XClose Panel
Xilinx Home
Reply
Visitor
orlee
Posts: 7
Registered: ‎07-13-2010
0
Accepted Solution

How to convert ADC Fix_14_0 output to CORDIC 1QN input

Hi,

 

  I am new to DSP so this is probably a trivial question to you. How do I convert

the input from an ADC with Fix_14_0 to the required CORDIC (or any other block)  that requires

a 1QN format of only 2 bits of integer? How do I keep the 14 bit dynamic range with only 2 bit?

 

Thanks,

 O.

Xilinx Employee
bwiec
Posts: 1,004
Registered: ‎08-02-2011
0

Re: How to convert ADC Fix_14_0 output to CORDIC 1QN input

Sounds like you're using SysGen.

 

You probably want a 'reinterpret' block.

www.xilinx.com
Super Contributor
vlavruhin
Posts: 195
Registered: ‎12-08-2010

Re: How to convert ADC Fix_14_0 output to CORDIC 1QN input

Hi, Orlee.

Lets consider different binary formats.

What does format 'Fix_14_0' means?
It means that number is signed with bitwidth = 14 without fractional part.
I.e., maximum positive number = 2^(14-1) - 1 = 8191, minimum negative number = -2^(14-1) = -8192:
01 1111 1111 1111. = 8191
...
00 0000 0000 0001. = 1
00 0000 0000 0000. = 0
11 1111 1111 1111. = -1
...
10 0000 0000 0000. = -8192
(Dot after bits of the number is symbol of the decimal point of the number.)

As you can see 'Fix_14_0' represents only integer numbers. But what we have to do to represent, for example, only fractional numbers, using 14 bits?
We can divide any number in 'Fix_14_0' format by 8192 (or 2^13). But what does it mean? It means that we just shift our decimal point to the left by 13 bits.
So this method gives us binary format 'Fix_14_13'.
I.e., maximum positive number = 8191 / 8192 = 1-2^[-(14-1)] = 0.99987793, minimum negative number = -8192/8192 = -1:
0.1 1111 1111 1111 = 0.99987793
...
0.0 0000 0000 0001 = 1/8192 = 0.000122070312
0.0 0000 0000 0000 = 0
1.1 1111 1111 1111 = -1/8192 = -0.000122070312
...
1.0 0000 0000 0000 = -1


Ok, now lets consider 1QN format.

1QN is 'Fix_N_(N-2)' format in terms of the System Generator.
If N = 14, it means that it can represent numbers with total bitwidth = 14 and fractional part = 12 bits.
I.e., maximum positive number = 2 - 2^[-(14-2)] = 1.99975586, minimum negative number = -2:
01. 1111 1111 1111 = 1.99975586
...
00. 0000 0000 0001 = 1/2^12 = 0.000244140625
00. 0000 0000 0000 = 0
11. 1111 1111 1111 = -1/2^12 = -0.000244140625
...
10. 0000 0000 0000 = -2


If you compare 'Fix_14_0', 'Fix_14_13' and 1QN 'Fix_14_12' formats, you'll see that bits are same. Only corresponding maximum and minimum decimal numbers are changed. So we can conclude that it's just matter of interpretation of bits.

 


orlee wrote:

How do I keep the 14 bit dynamic range with only 2 bit?


You don't need to truncate 14 bits to 2 bits. Just imagine that input 'Fix_14_0' can be interpreted as 'Fix_14_12' number.


Finally, lets look at CORDIC IP (http://www.xilinx.com/support/documentation/ip_documentation/cordic_ds249.pdf).
Its input format depends on chosen function.

Consider, for example, vector rotation (page 8).
Its inputs x and y should be numbers in range [-1, 1]:
-1 <= x <= 1
-1 <= y <= 1

So using 1QN 'Fix_14_12' format:
01. 0000 0000 0000 = 1 is maximum allowed number
11. 0000 0000 0000 = -1 is minimum allowed number

If you get input data from the output of 14-bit ADC, then you should choose proper scaling of this data depending on intended CORDIC's operation range.
You can scale output ADC range to any input CORDIC range.

 

Hope this explanation will be useful for you.

 

And as Bwiec has noted there is a 'Reinterpret' block in the System Generator, where you can force binary point to 12 bit.

Best Regards,
Vitaly.
Visitor
orlee
Posts: 7
Registered: ‎07-13-2010
0

Re: How to convert ADC Fix_14_0 output to CORDIC 1QN input

Thank you so much. This is an excellent explanation. You are very good !

 

O

Visitor
yu_luo
Posts: 16
Registered: ‎12-26-2012
0

Re: How to convert ADC Fix_14_0 output to CORDIC 1QN input

it's useful for me.