This is a homework question that I am stuck with.
Consider unsigned integer representation. How many bits will be required to store a decimal number
This one works!
floor(loge(n) / loge(2)) + 1
To include negative numbers, you can add an extra bit to specify the sign.
floor(loge(abs(n)) / loge(2)) + 2