PC Hardware A Beginner’s Guide

(ff) #1

Converting Decimal to Binary


Here’s a quick way to convert a decimal number into a binary number:


  1. Divide the decimal number by 2 and keep the answer. Write down the
    remainder (you may want to start writing down the remainders on the
    right side of the paper); it will be either a 1 or a 0.

  2. Divide the answer by 2 and record the remainder to the left of the
    first remainder.

  3. Repeat step 2 until the number in the answer is either a 1 or a 0 and
    record it to the left of the last remainder.


For example, if you used the above procedure to convert the number 2,469 to
a binary number, it would go like this:


  1. 2,469 divided by 2 equals 1,234 with a remainder of 1

  2. 1,234 divided by 2 equals 617 with a remainder of 0

  3. 617 divided by 2 equals 308 with a remainder of 1

  4. 308 divided by 2 equals 154 with a remainder of 0

  5. 154 divided by 2 equals 77 with a remainder of 0

  6. 77 divided by 2 equals 38 with a remainder of 1

  7. 38 divided by 2 equals 19 with a remainder of 0

  8. 19 divided by 2 equals 9 with a remainder of 1


Chapter 3: Microprocessors^43


Bit Power of Two Decimal
120 1
221 2
322 4
423 8
524 16
625 32
726 64
827 128

Table 3-1. The Bit Values in a Byte
Free download pdf