Unless I'm mistaken, picking off the top bits results in truncation and not rounding. If it matter in your application, you need to add one half in whatever your fraction units are, before you pick off the top bits. Otherwise, your results will all be biased 1/2 unit down on the average. Using the 8 and 8 bit scheme as an example, Just picking off: 03.81 becomes 3 Rounding: 03.7f + .80 = 3.ff then becomes 3 03.81 + .80 = 4.01 then becomes 4 Greg Coleman > then if you need to use the filtered reading for anything, pick off the > top ten bits of FILT. Say you have a display function that takes a 16 > bit variable as a parameter: > > display(FILT >> 6); // (but don't use FILT = FILT >> 6; to work with > // it; you'll lose the fraction bits > > As Olin pointed out, if you use an 8 bit a/d reading and 8 fraction bits, > the bit shifting in this example simply becomes a matter of selecting > high and low bytes. And if FF = 1/256, then the divide(s) get real > simple too! > > Hope this helps. > -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.