Nios/pow2
From ASMBits
nios/popcountPrevious
Nextnios/mask
Write a function that will return whether its parameter is a power of 2. The parameter is an unsigned integer and will not be 0.
int pow2(unsigned int num);
Expected solution length: Around 4 lines.
Sample Input
pow2(4)
Sample Output
r2=1
nios/popcountPrevious
Nextnios/mask