Arm/bits1
From ASMBits
arm/saturate2Previous
Nextarm/bits2
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
0x1000
Sample Output
r0=13
arm/saturate2Previous
Nextarm/bits2