Google
 

Wednesday, February 6, 2008

Converting a Decimal Number

Converting a Decimal Number to a Binary Octet

To convert the decimal number 207 to a binary octet, follow these steps:

  1. Compare the decimal number you want to convert (in this case 207) to the number 128. If the decimal number is greater than or equal to 128, subtract 128 and write down a 1. If the decimal number is less than 128, subtract 0 and write down a 0.

    207 > 128

    207 – 128 = 79

    Write down 1 for the 128s place

    Answer so far: 1

  2. Take the result from step 1 (79 in this case) and compare it to the number 64. If the decimal number is greater than or equal to 64, subtract 64 and write down a 1. If the decimal number is less than 64, subtract 0 and write down a 0.

    79 > 64

    79 – 64 = 15

    Write down a 1 for the 64s place

    Answer so far: 11

  3. Take the result from step 2 (15 in this case) and compare it to the number 32. If the decimal number is greater than or equal to 32, subtract 32 and write down a 1. If the decimal number is less than 32, subtract 0 and write down a 0.

    15 <>

    15 – 0 = 15

    Write down a 0 in the 32s place

    Answer so far: 110

  4. Compare the result from step 3 to the number 16. If the number is greater than or equal to 16, subtract 16 and write down a 1. If the number is less than 16, subtract 0 and write down a 0.

    15 <>

    15 – 0 = 15

    Write down a 0 in the 16s place

    Answer so far: 1100

  5. Compare the result of step 4 to the number 8. If the decimal number is greater than or equal to 8, subtract 8 and write down a 1. If the decimal number is less than 8, subtract 0 and write down a 0.

    15 > 8

    15 – 8 = 7

    Write down a 1 in the 8s place

    Answer so far: 11001

  6. Compare the result of step 5 to the number 4. If the decimal number is greater than or equal to 4, subtract 4 and write down a 1. If the decimal number is less than 4, subtract 0 and write down a 0.

    7 > 4

    7 – 4 = 3

    Write down a 1 in the 4s place

    Answer so far: 110011

  7. Compare the result of step 6 to the number 2. If the decimal number is greater than or equal to 2, subtract 2 and write down a 1. If the decimal number is less than 2, subtract 0 and write down a 0.

    3 > 2

    3 – 2 = 1

    Write down a 1 in the 2s place

    Answer so far: 1100111

  8. If the result of step 7 is a 1, write down a 1. If the result of step 7 is a 0, write down a 0.

    1 = 1

    Write down a 1 in the ones place

    Final answer: 11001111

You have now converted the decimal number 207 to its binary equivalent 11001111

No comments: