In: Computer Science
1.Convert (FA)16 to decimal
2.Convert (10101110)2 to decimal.
3.Convert (0.10101)2 to decimal.
1. To convert (FA)16 to decimal multiply each digit with its power of 16
Hex digits are: 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
F = 15, A = 10
15*161 + 10*160 = 15*16 + 10*1 = 240 + 10 = 250
Therefore, (FA)16 = 250 in decimal.
2. To convert (10101110)2 to decimal multiply each digit with its power of 2
Digit | 1 | 0 | 1 | 0 | 1 | 1 | 1 | 0 |
Power of 2 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 |
Digit * power of 2 | 128 | 0 | 32 | 0 | 8 | 4 | 2 | 0 |
Now, add up the values obtained on multiplying digit and power of 2.
128 + 0 + 32 + 0 + 8 + 4 + 2 + 0 = 174
Therefore (10101110)2 = 174 in decimal.
3. To convert (0.10101)2 to decimal multiply each digit before the fractional part with power of 2 and divide each digit of the fractional part with the power of 2.
We have 0 before the fractional part, so we multiply 0 with power of 2 corresponding to its place i.e., 0*20 = 0
Digit | 1 | 0 | 1 | 0 | 1 |
Power of 2 | 21 | 22 | 23 | 24 | 25 |
Divide each digit by power of 2 | 1/2 = 0.5 | 0/4 = 0 | 1/8 = 0.125 | 0/16 = 0 | 1/32 = 0.03125 |
Now, add up the values
0.5 + 0 + 0.125 + 0 + 0.03125 = 0.65625
To get the decimal value of (0.10101)2 add the part before the fractional part and the fractional part as obtained above i.e., 0 + 0.65625 = 0.65625
Therefore the decimal valus of (0.10101)2 is 0.65625