We know that 4-bit unsigned integers range from 0000 to 1111 in binary numeral system (see http://www.cs.uwm.edu/classes/cs315/Bacon/Lecture/HTML/ch04s10.html).
Therefore, there are 16 numbers from 0 to 15.
We know that the sum of numbers from 1 to n can be calculated as (see https://en.wikipedia.org/wiki/1_%2B_2_%2B_3_%2B_4_%2B_%E2%8B%AF). So the sum of integers from 0 to 15 will be
Comments
Dear EVELYN, You are welcome. We are glad to be helpful. If you liked our service, please press a like-button beside the answer field. Thank you!
thanks