Hi Basically you want to multiply your number by 102 and then divide it by 256. y = (x * % byte)/256 An 8 bit by 8 bit multiply would give you a 16 bit answer. You can divide by 256 by just using the high byte and discarding the low byte. 204 * 128 == 26112 (6600 Hex) 66 hex is 102 decimal. MChip has some multiply routines on their site. Dave ----- Original Message ----- From: "Josh Koffman" To: Sent: Saturday, November 24, 2001 12:54 PM Subject: [PIC]: Scaling numbers > Anyway, I have a question about scaling. Basically what I want to do is > to have a few (8-32 maybe) registers with 8 bit values in them. Then, > based on another 8 bit value I want to scale them. Basically, the second > register becomes a percentage multiplication factor. So if I have a > value of d'204' in the first register, and a value of d'128' in the > second (50%), after the operation I want a result of d'102' (half of the > original value). It can be in a second register. At first I though of > just using multiplication routines, but I can't figure how to multiply > by less than 1 (ie 0.5). I had a flash that maybe this could all be > accomplished by shifting bits, but I don't know how. Any pointers to > info would be great! > -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics