View Single Post
  #3 (permalink)  
Old 10-26-2009, 05:56 PM
Tim Wescott
Guest
 
Posts: n/a
Default Re: Fixed point arithmetic

On Mon, 26 Oct 2009 10:53:23 -0400, Jerry Avins wrote:

> thunder wrote:
>> Hi
>>
>> I have a question regarding Fixed point Arithmetic addition.
>>
>> For example, i have two fixed point numbers:
>>
>> a = unsigned Q7.8 format (7-bit integer, 8 bit factional). b = unsigned
>> Q7.8 format ( " " ).
>>
>> Now a + b = c, where c is an unsigned Q8.8 result.

>
> Then there is overflow, just as two Q15.0 integers and getting a Q16.0
> sum. (Remember the sign bit.)
>
>> Qs: How do I transform c into d, where d is a unsigned Q7.9 result ??

>
> You can't. Count the bits. (Remember the sign bit.)
>

You can't on a 16-bit machine, but if you're working in an FPGA or custom
logic a 17-bit type is no problem.

> ...
>
>> QS; Can anyone recommend a good book on Fixed Point and Floating point
>> arithmetic ?

>
> http://www.digitalsignallabs.com/fp.pdf
>
> Jerry






--
www.wescottdesign.com
Reply With Quote