One way to convert decimal to binary is to perform successive divisions by 2, checking for an odd or even number at each step. If odd, then record a 1 for the bit, and subtract one from the quotient. If even, then record a 0 for the bit. Continue dividing by 2 until the number become fractional.

For example:

2001 | odd | 1 | least significant digit | |

sub 1, div 2 | 1000 | even | 0 | |

div 2 | 500 | even | 0 | |

div 2 | 250 | even | 0 | |

div 2 | 125 | odd | 1 | |

sub 1, div 2 | 62 | even | 0 | |

div 2 | 31 | odd | 1 | |

sub 1, div 2 | 15 | odd | 1 | |

sub 1, div 2 | 7 | odd | 1 | |

sub 1, div 2 | 3 | odd | 1 | |

sub 1, div 2 | 1 | odd | 1 | most significant digit |

Answer: 0111 1101 0001

Alternatively, convert 2000_{10} first to hex, then that number (7D1_{H}) to binary.

"http://www.physics.udel.edu/~watson/phys345/protected/exercises/hints/D9-4.html"

Last updated Oct. 22, 1998.

Copyright George Watson, Univ. of Delaware, 1998.