Hi Gordon, Another solution that may-or-may-not be better (profile to find out) is to do a 2048 sized (11-bit) lookup table and use 3 lookups. Or 6 lookups for a 64-bit number. Another solution is the "divide-and-conquer" folding bit-twiddling method. Note, there is a couple of shortcomings on the "x & (x-1)" trick. I presume you are aware of those shortcomings. HTH, --Eljay