Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Binary numbers- how to normalize?

  1. Apr 21, 2010 #1
    1. The problem statement, all variables and given/known data

    Find the binary form of x= 7/10

    Suppose that the number x= 7/10 is to be stored in a 32-bit computer, find the nearby machine numbers x_ and x+

    2. Relevant equations

    3. The attempt at a solution

    I have found that 7/10 in binary form is: 0.101100110011001100......

    However I don not know how to normalise/ standardise this. Can anybody help please!
  2. jcsd
  3. Apr 21, 2010 #2


    User Avatar
    Science Advisor
    Homework Helper

    Not sure exactly what you mean by normalise.

    7/10 like most numbers can't be stored exactly in binary (just as 1/3 can't be stored exactly in decimal)
    If you only have 32bits (ie 32 places) what are the nearest 32bit binary numbers made by rounding this sequence up and down? What fractions do they correspond to?
  4. Apr 21, 2010 #3
    ok i'm not entirely sure either if i'm honest but let me try and explain using an example:

    If i find that the binary form of x= 2/7 to be: 0.0101001001....

    which when normalised becomes: (1.001001001....)x 2^-2

    its the last line, that i do not know how to derive
  5. Apr 21, 2010 #4


    User Avatar
    Science Advisor
    Homework Helper


    Showing this as 2^-n, ie 1/2 + 1/4 + 1/8 + 1/16, truncating this to 32bits and splitting into 8bits to make it readable
    10110011 00110011 00110011 00110011 (0011......)

    rounding up the remaining (0011...) would give you
    10110011 00110011 00110011 00110100

    Now just convert these back into decimals
    Now work out what
  6. Apr 21, 2010 #5

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    Some more things to think about regarding floating point
    • You better to reserve one of those 32 bits for the sign. Otherwise, how do you represent -7/10?
    • You better reserve some of the remaining 31 bits for the exponent. Otherwise, how do you represent 7/1000000?
    • Every positive number can be expressed as 1.xxxxxx...*2exponent. This is the normalized form. When normalized, there will be one digit to the left of the binary point and it is always one. Do you need to store that leading one?

    It works the same way it works in decimal. Consider 1/400=0.0025. Let's normalized this. In general, you shift the decimal point until you finally get exactly one nonzero digit to the left of the decimal point, keeping track of how many places you moved the decimal point (to the left=positive, right=negative). In this case you have to move the decimal point three places to the right. The normalized form is 2.5×10-3.

    No difference conceptually in binary. The base is 2, so instead of multiplying by 10shift count you are multiplying by 2shift count.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook