piclist 2001\04\04\073702a >
Thread: Any clever implementations of rounding out there ?
www.piclist.com/techref/microchip/devices.htm?key=pic
picon face BY : Bob Ammerman email (remove spam text)



----- Original Message -----
From: Kübek Tony <tony.kubekTakeThisOuTspamspamFLINTAB.COM>
To: <TakeThisOuTPICLISTspam_OUTspamspamMITVMA.MIT.EDU>
Sent: Wednesday, April 04, 2001 4:32 AM
Subject: Re: [PIC]: Any clever implementations of rounding out there ?


Hi,

Bob Ammerman wrote:
>I don't know if this is clever, but it is simple.
>
>Assuming positive values:
<snip>
Well pretty clever :) didn't think of that myself,
was trying an ( proved to be a tad hard ) 'extraction'
of the ones and tens digits from the 24 bit value,
took about 150'ish cycles, then I had to add the actual
add/subtract bit. Anyway these would probably take
less cycles. I'll try them.
Do not want to use div/mul way to many cycles.
( for 24 bit inputs,outputs )

Thanks,

/Tony

Tony,

Watch out!!!

The div/mul free techniques can be VERY slow because it is basically
simulating the division via repeated subtraction. As my original comment
said: if cycles are important, then these techniques wont work.

Ouch!

Bob Ammerman
RAm Systems
(contract development of high performance, high function, low-level
software)





Tony Kübek, Flintab AB
²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²
E-mail: EraseMEtony.kubekspam_OUTspamspamflintab.com
²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


<008701c0bcfb$68e00960$f5e8c540@CDS> quoted-printable

See also: www.piclist.com/techref/microchip/devices.htm?key=pic
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) Any clever implementations of rounding out there ?

month overview.

new search...