Bill, did you mean you want to convert 4 bit binary to 4 bit BCD? if so, just make sure you do not use anything over 9 and you have BCD. If on the other hand you meant to say convert 4 bit binary to some arbitrary list of symbol values, then by all means use a lookup table. I won't repeat it all here, it is in the app notes, and has been shown on this list before. I will say, though, that it is a great idea to tuck your lookup table somewhere in program space near the begining of the page so that adding code before it does not push it over the page to the next. The app note will tell you why. The second strong suggestion is to bounds check your lookup offset before jumping into the table. With your 4 bit value, make certain you have 16 values in the table, and then just AND your offset with 0x0F before jumping. This will keep any accidental bit pickups from making your code leap off into the ether (sorry, it has been renamed to cyberspace). Chris Eddy Pioneer Microsystems, Inc. Bill Colville wrote: > Hello all. > > I am working on a project that requires doing a binary to decimal > conversion using the interrupt-on-change feature on Port B of an > 'F84. I have a 4 bit binary counter connected to the high bits of > port B and I need to be able to address one of 16 specific registers > corresponding to each change in binary input. The counter clock is > 8kHz and the 'F84 has a 10MHz crystal so there should be plenty of > time to do the conversion and the small amount of processing I need > to do. > > I believe that binary to decimal conversion was discussed here some > time ago but I haven't been able to locate it. Any help you can give > me will be greatly appreciated. > > TIA > Bill, W3NMK