I have 5 bit numbers like
10000 01000 00100
If only one bit is on in my calculation i have no problem.
but if 2 bits are on then I
return log2(n & -n) + 1;
this will may help you.