On Tue, Feb 9, 2010 at 12:36 AM, Josh Koffman wrote: > Hi all. I'm thinking of a project where I'll have a 9 bit binary > number, and I'll want to display it on a 3 digit 7 segment display. To > do this I'll need to extract the hundreds, tens, and ones digits from > the number. The PICList.org website has an 8 bit version to do this > (http://www.piclist.org/techref/microchip/math/radix/b2oth-8b3d-jsv.htm). > Has anyone seen a 9 bit version (or a higher bit version that's easily > foolable, I guess up to 16 bit would be easy)? I've decided to limit myself to an input of 255 for now. Once I get that working I'll move on to getting the extra bit to work and adding on to my existing 8 bit to H,T,O. I'm starting to work with the routine linked to in my original email. I'm rewriting it in my own style to make sure I understand how it works. I got the hundreds conversion (at least I think I understand it). I must admit I've lost the scent on the tens and ones. The author notes that they should be run together, but I can't see why. In fact it seems to me that if they are run together then the routine won't output the number of tens anywhere. Also shouldn't the hundreds routine feed into the tens routine? Man I'm confused. Continuing web searching, but any help would be appreciated. Thanks! Josh -- A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. -Douglas Adams -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist