Check out the piclist.com website (http://www.piclist.com) specifically http://www.piclist.com/techref/microchip/math/radix/index.htm The code is in assembler, but perhaps it will be of some help. Josh -- A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. -Douglas Adams "F.A.C.T. / Vladimir M Skrbic" wrote: > My name is Vladimir and I'm from Yugoslavia. I am working on a > Thermometer/thermostat project based on a PIC 16F84. I am using a Dallas > DS1821 temperature sensor and since I don't have enough pins I decided > to use 4511 BCD to 7 Segment LED Driver IC. Now I am writing my code in > Pic Basic Pro and I'm not certain how to convert 8 bit binary data > coming out from the sensor to a 4 bit BCD (B0-B3 pins -> D,C,B,A) in > order to drive the 4511. Can you give me a hand, please? Thank you in > advance. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu