n = 16 - __builtin_clz (x);
n = (sizeof (int) * 8) - __builtin_clz (x);
Stupid me! I forgot to say that I'm looking for a hardware solution. Best without any clock cycles.... and thanks for the help so far!
My sense is for a lot of the computers that have a count leading zeros instruction
If all you have is the 16 ring counter inputs, you can use a pair of 74LS348 priority Encoders.
or one 74LS150...