Nios/bits2
From ASMBits
nios/bits1Previous
Nextnios/add64
A signed (two's complement) number of n bits can represent values between -2n-1 and +(2n-1-1), inclusive. Write a function that returns how many bits are needed to represent a given number, in signed binary representation.
unsigned int bits(int num);
Expected solution length: Around 15 lines.
Sample Input
0x1000
Sample Output
r2=14
nios/bits1Previous
Nextnios/add64