convert the following fixedpoint numbers to decimal a 101011
convert the following fixed-point numbers to decimal
a) 101.011 in 3.3.
b) 101.011 in s2.3
Solution
In decimal numbers, the digits have values that are powers of ten. Starting at the implied decimal point and working to the left, the number 403 is equal to:
3 x 100 + 0 x 101 + 4 x 102 = 3x1 + 0x10 + 4x100 = 3 + 0 + 400
In binary, the digits have values that are powers of two. Working to the left as before, the number 101 is equal to:
1 x 20 + 0 x 21 + 1 x 22 = 1x1 + 0x2+ 1x4 = (in decimal) 1 + 0 + 4 = 5
So, 1111 1111 = 1x1 + 1x2 + 1x4 + 1x8 + 1x16 + 1x32 + 1x64 + 1x128 = 255.
This also works to the right of the decimal point, but the powers of two are negative (i.e., fractions), so 101.011 in binary is:
1x1/8 + 1x1/4 + 0x1/2 + 1x1 + 0x2 + 1x4 = 5.375
Where the first digit to the right of the decimal point is 2-1 (one-half, or 1/2), the next is 2-2 (1/4), then 2-3 (1/8), etc.
