Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Decimal to binary help

  • 23-09-2018 2:03pm
    #1
    Registered Users Posts: 114 ✭✭


    Hi just a quick question

    I have being given the decimal 672.1 and need to convert it to binary.ok so I calculate 672 by long dividing by 2 to get the binary answer but 0.1 seems infinite..how would I know where to stop..I mean I know to multiply by 2 each time and record the ones and zeros.

    The teacher didn't specify how many bits should be after the decimal point for an answer.when I do the calculation online the result is large after the decimal point.

    Amy help would be appreciated
    Thanks


Comments

  • Registered Users Posts: 1,595 ✭✭✭MathsManiac


    The answer is recurring.
    Just as in decimal, some fractions do not have terminating decimal values but instead give infinite recurring decimals, so to can this happen in binary.

    In decimal, the digits after the decimal point represent 1/10, 1/100, 1/1000, etc. For some fractions, you cannot express them as an even (finite) sum of these fractions that are powers of ten, so no matter how far out you go, you never get to it exactly.

    Same applies in binary - the digits after the point represent 1/2, 1/4, 1/8, etc., and if the fraction cannot be expressed evenly as a sum of those fractions, the binary expansion will recur.

    In this case, the fraction 1/10, which has a nice even decimal expression of 0.1, is not so nice in powers of 2, so you get .00011001100110011...

    The conventional way to write a recurring decimal is to place a dot over the first and last digits in the recurring pattern.


  • Registered Users Posts: 114 ✭✭carter001


    The answer is recurring.
    Just as in decimal, some fractions do not have terminating decimal values but instead give infinite recurring decimals, so to can this happen in binary.

    In decimal, the digits after the decimal point represent 1/10, 1/100, 1/1000, etc. For some fractions, you cannot express them as an even (finite) sum of these fractions that are powers of ten, so no matter how far out you go, you never get to it exactly.

    Same applies in binary - the digits after the point represent 1/2, 1/4, 1/8, etc., and if the fraction cannot be expressed evenly as a sum of those fractions, the binary expansion will recur.

    In this case, the fraction 1/10, which has a nice even decimal expression of 0.1, is not so nice in powers of 2, so you get .00011001100110011...

    The conventional way to write a recurring decimal is to place a dot over the first and last digits in the recurring pattern.

    Thanks


Advertisement