From ASMBits

An unsigned number of n bits can represent values between 0 and 2n-1, inclusive. Write a function that returns how many bits are needed to represent a given number, in unsigned binary representation.

unsigned int bits(unsigned int num);

Expected solution length: Around 3 lines.

Sample Input


Sample Output


The CLZ (count leading zeros) instruction may be useful.

Write your solution here

Upload a source file...