- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
How to convert ADC Fix_14_0 output to CORDIC 1QN input
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
03-02-2012 09:48 AM
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.
Solved! Go to Solution.
Re: How to convert ADC Fix_14_0 output to CORDIC 1QN input
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
03-02-2012 02:05 PM
Sounds like you're using SysGen.
You probably want a 'reinterpret' block.
Re: How to convert ADC Fix_14_0 output to CORDIC 1QN input
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
03-02-2012 02:36 PM
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_doc
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.
Vitaly.
Re: How to convert ADC Fix_14_0 output to CORDIC 1QN input
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
03-05-2012 03:43 PM
Thank you so much. This is an excellent explanation. You are very good !
O
Re: How to convert ADC Fix_14_0 output to CORDIC 1QN input
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-28-2012 10:23 PM
it's useful for me.











