Docsity

Floating Point Representation of the Number 5, Study notes of Operating Systems

Toggle sidebar
bg1
Floating point example
How is 5 represented in floating point?
Step 1: express as binary number
101.0
Step 2: determine sign bit
5 is positive number, so sign bit is 0
Step 3: Determine the exponent by putting number in form 1.fffffff x 2exponent
1.010 x 22 so the exponent is 2
Step 4: Add 127 to the exponent
2 + 127 = 129
Step 5: Convert exponent to binary.
129 = 10000001
Step 6: Determine the fraction part, by removing the leading 1.
.010
Step 7: Put the parts together (drop the decimal point).
0 10000001 01000000000000000000000
Step 8: Double check your result, being sure to put the 1 in front of the fraction part:
+ 1.010 x 2129-127
+ 1¼ x 22
+ 1.25 x 4
+ 5

Partial preview of the text

Download Floating Point Representation of the Number 5 and more Study notes Operating Systems in PDF only on Docsity!

Floating point example

How is 5 represented in floating point? Step 1 : express as binary number

Step 2 : determine sign bit 5 is positive number, so sign bit is 0 Step 3 : Determine the exponent by putting number in form 1.fffffff x 2exponent 1.010 x 2^2 so the exponent is 2 Step 4 : Add 127 to the exponent 2 + 127 = 129 Step 5 : Convert exponent to binary. 129 = 10000001 Step 6 : Determine the fraction part, by removing the leading 1. . Step 7 : Put the parts together (drop the decimal point). 0 10000001 01000000000000000000000 Step 8 : Double check your result, being sure to put the 1 in front of the fraction part:

  • 1.010 x 2129-
  • 1¼ x 2^2
  • 1.25 x 4
  • 5