Converting number bases: fractions | ||||||||||
Given: decimal fraction representation | ||||||||||
Find: binary representation | ||||||||||
value: | 0.375ten | |||||||||
b-1 | b-2 | b-3 | b-4 | b-5 | ||||||
weight | 2-1 | 2-2 | 2-3 | 2-4 | 2-5 | |||||
0.5 | 0.25 | 0.125 | 0.0625 | 0.03125 | ||||||
digit | 0. | |||||||||
To convert a whole number, we successively divided by 2 | ||||||||||
What should we do with a fraction? | ||||||||||
0.375ten | = b-1 * 2-1 + b-2 * 2-2 + b-3 * 2-3 + b-4 * 2-4 + etc. | |||||||||