Binary numbers- how to normalize?

Click For Summary
SUMMARY

The discussion focuses on normalizing the binary representation of the fraction x = 7/10 for storage in a 32-bit computer. The binary form of 7/10 is identified as 0.101100110011001100..., which cannot be stored exactly in binary. Participants explain the process of rounding to find the nearest 32-bit binary numbers and emphasize the importance of normalizing the number into the form (1.xxxxxx...) x 2^exponent. Key considerations include reserving bits for the sign and exponent to accurately represent both positive and negative values.

PREREQUISITES
  • Understanding of binary number representation
  • Familiarity with floating-point arithmetic
  • Knowledge of 32-bit computer architecture
  • Basic concepts of normalization in numerical systems
NEXT STEPS
  • Learn about IEEE 754 floating-point representation
  • Explore binary rounding techniques for floating-point numbers
  • Study the process of converting binary fractions to decimal
  • Investigate the implications of bit allocation for sign and exponent in floating-point numbers
USEFUL FOR

Students studying computer science, software engineers working with numerical computing, and anyone interested in understanding binary normalization and floating-point representation.

ruby_duby
Messages
46
Reaction score
0

Homework Statement



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+


Homework Equations





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!
 
Physics news on Phys.org
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?
 
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
 
0.101100110011001100110011001100

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
 
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?
ruby_duby said:
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

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.
 

Similar threads

  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 10 ·
Replies
10
Views
4K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
11K
Replies
1
Views
4K
Replies
4
Views
2K