Hi all, I have to do some oddball counting in binary, and I was wondering if there was some standard table to make sure I get this right. I have to, for example, count from 0 to 4. I do this by setting the appropriate number of bits to 1. For example: 0000 = 0 0001 = 1 0011 = 2 0111 = 3 1111 = 4 However, I also have to keep the '1' bits as far from each other as possible. Again, using 0 to 4 for the example: 0000 = 0 0001 = 1 0101 = 2 1101 = 3 1111 = 4 (there is quite a difference when you have a count of 16 or 32). This isn't a gray code, and isn't a balanced gray code, either. Is this a "standard" thing? Does it have a name? And a standard set of bits? Thanks, Bill --- Psst... Hey, you... Buddy... Want a kitten? straycatblues.petfinder.org -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist