im looking for the algorithm like is it 2^(n-1)
for example 1010 have n=4 2^3=8 but 1010=10
so how do you get it
Last edited on
A quick tut:
Take the decimal integer:
104
This can be mathematically expressed as:
104 = 1 * 10^2 + 0 * 10^1 + 4 * 10^0
Since decimal is a base ten system, the bases for the exponential operation is 10.
Now, take the binary:
100101
This can be expressed in decimal as:
100101b = 1 * 2^5 + 0 * 2^4 + 0 * 2^3 + 1 * 2^2 + 0 * 2^1 + 1 * 2^0 =
32 + 0 + 0 + 4 + 0 + 1 =
37
Last edited on