Converting Decimal to Binary
Here’s a quick way to convert a decimal number into a binary number:
- 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. - Divide the answer by 2 and record the remainder to the left of the
first remainder. - 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:
- 2,469 divided by 2 equals 1,234 with a remainder of 1
- 1,234 divided by 2 equals 617 with a remainder of 0
- 617 divided by 2 equals 308 with a remainder of 1
- 308 divided by 2 equals 154 with a remainder of 0
- 154 divided by 2 equals 77 with a remainder of 0
- 77 divided by 2 equals 38 with a remainder of 1
- 38 divided by 2 equals 19 with a remainder of 0
- 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