clever rounding out there ?
Roman Black email (remove spam text)
Bob Ammerman wrote:
Excellent work Bob! So, it would take about:
1. add 25 to the 24bit number. (6)
2. extract the 10s and 1s digits. (68)
3. if 10s is greater than 5 subtract 5 from it. (7)
4. multiply 10s by 10 (simple lookup table, 5 bytes) (5)
5. add 1s to 10s (this is now the 50 modulus) (2)
6. subtract the modulus from the 24bit number (6)
That's only about 94 instructions, give or take
a few. :o)
So that would be on a 18C series PIC, how much
larger would it become if using only a 16 series
PIC I wonder??
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email mitvma.mit.edu with SET PICList DIGEST in the body listserv
See also: www.piclist.com/techref/microchip/devices.htm?key=pic
You must be a member of the
piclist mailing list
(not only a www.piclist.com member) to post to the