Re: 32 bit fixed point division
- From: "sbhavikb" <sbhavikb@xxxxxxxxxxxxxx>
- Date: Fri, 30 Sep 2005 22:24:50 -0500
>sbhavikb wrote:
>> >> uint64_t remainder;
>...
>> >> remainder = remainder << 1;
>...
>> Hay, can anyone please give a code for 32 bit fixed point division
which
>> would work for a 32 bit DSP processor. It looks like this code will
not
>> work, as it involves working with a 64 bit integer.
>
>These operations on large unsigned integers can be broken down into
>operations on sets of smaller integers. For instance, a left
>shift on a uint64 can be broken down into shifting two 32-bit integers,
>plus copying the former MSB of one into the resulting LSB of the
>other. See any textbook on binary arithmetic or multi-precision
>arithmetic.
>
>So the earlier posted code will work just fine, with simple
>modifications, not only for 32-bit processors, but for 16-bit and
>8-bit CPU's as well.
>
>And if you want a potentially faster multi-precision integer division
>routine, look into non-restoring algorithms, which can save on some
>comparison cycles.
>
>
>IMHO. YMMV.
>--
>rhn A.T nicholson d.O.t C-o-M
>
>
Hi,
Thank you very much for the suggestion. But my intension to ask the
question was to have the answer of the division routine in 32 bit. The
posted routine gives the answer as 64 bit integer which I can not use in
my program, as there are so many other routines which have to follow the
division routine and those have to take 32 bit answer of the division
routine. I tried converting this 64 bit answer in 32 bit but somehow it
didnt work out. Can you please suggest some way out?
Thank you very much,
Thanks and Regards,
BS
This message was sent using the Comp.DSP web interface on
www.DSPRelated.com
.
- Follow-Ups:
- Re: 32 bit fixed point division
- From: Randy Yates
- Re: 32 bit fixed point division
- Prev by Date: Re: About DFT
- Next by Date: Re: About DFT
- Previous by thread: Re: 32 bit fixed point division
- Next by thread: Re: 32 bit fixed point division
- Index(es):
Relevant Pages
|