You can use a lookup table...
/* this is only needed once, if lut is global or static */
unsigned char lut[65];
lut[1]=1;
lut[2]=2;
lut[4]=3;
lut[8]=4;
lut[16]=5;
lut[32]=6;
lut[64]=7;
...
...
...
/* Perform the conversion */
answer = lut[byte];
Or you can even use some math...
answer = 1 + log(byte)/log(2);