UPGRADE YOUR BROWSER
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!
10-14-2019 12:45 AM
Hi all,
I am using FIR compiler v7.2 for my system. I input the data to FIR with format 16Q15 (or Q.15) and the output of FIR is 32Q15 (or Q17.15). I want to convert this format to Q.15 like input. So, is there anyway to do this ?
Thank you,
11-12-2019 03:15 AM
I am using FIR compiler v7.2 for my system. I input the data to FIR with format 16Q15 (or Q.15) and the output of FIR is 32Q15 (or Q17.15). I want to convert this format to Q.15 like input. So, is there anyway to do this ?
As mentioned by @drjohnsmith, we can use the truncate option here. But it will not work here due to below reason,
Reason: The output Q17.15 i.e. 17 interger bits are required for full scaled output. If we use Q.15 format, then we have 1 bit for integer output. Hence the lower 16 bit will be discarded by the compiler. In the other words, the output will be attenuated by a factor of 2^16.
Another thing to notice is, your input is 16Q15, but output is 32Q15 i.e. we have large value of coefficients (as the output is multiplication and add operation of coefficent and input data). May be you can play with coefficient values to reduce the output size and then use the truncate option.
10-14-2019 02:10 AM
Thinking of base 10 numbers,
if you multiply 99 by 99, you get 9801,
to put that back into the sam eformat , yo move the decimal point twoto the left, to give 98.01 , as an integer 98
'All' the Q format is doing it saying where the binary point is,
10-14-2019 02:17 AM
https://en.wikipedia.org/wiki/Fixed-point_arithmetic
https://en.wikipedia.org/wiki/Q_(number_format)
http://www.ee.ic.ac.uk/pcheung/teaching/ee3_Study_Project/lecture%205(4).pdf
10-14-2019 02:20 AM
I have just quickly checked,
you can also set the output size in the FIR compiler, and the method of truncation
11-12-2019 03:15 AM
I am using FIR compiler v7.2 for my system. I input the data to FIR with format 16Q15 (or Q.15) and the output of FIR is 32Q15 (or Q17.15). I want to convert this format to Q.15 like input. So, is there anyway to do this ?
As mentioned by @drjohnsmith, we can use the truncate option here. But it will not work here due to below reason,
Reason: The output Q17.15 i.e. 17 interger bits are required for full scaled output. If we use Q.15 format, then we have 1 bit for integer output. Hence the lower 16 bit will be discarded by the compiler. In the other words, the output will be attenuated by a factor of 2^16.
Another thing to notice is, your input is 16Q15, but output is 32Q15 i.e. we have large value of coefficients (as the output is multiplication and add operation of coefficent and input data). May be you can play with coefficient values to reduce the output size and then use the truncate option.