written 7.9 years ago by | • modified 2.9 years ago |
Mumbai University > Computer Engineering > sem 4> Computer Organization and Architecture
Marks: 5M
Year: May16
written 7.9 years ago by | • modified 2.9 years ago |
Mumbai University > Computer Engineering > sem 4> Computer Organization and Architecture
Marks: 5M
Year: May16
written 7.9 years ago by |
Step 1: Convert the decimal number to its binary fractional form.
Convert this format is in base2 format For this, first convert 172 in to binary format
35=100011
Convert 0.25 in to binary format
0.25*2=0.50 0
0.50*2=1.0 1
0.25=10
Binary format of 35.25=100011.10
Shifting this binary number
1.00011102 *5 Normalized
1.0101100 is mantissa
2 **7 is exponent
add exponent 127 7+127=134
Step 2: Normalize the binary fractional number.
Move the decimal point left or right so that only a single binary digit "1" is to the left of the binary decimal point. Compensate by adjusting the exponent in the opposite direction.
1.0001110 times 2*5
Moving the decimal left seven decreases the size of the number; so, we use an exponent of 5 to compensate and keep the number the same size.
Step 3: Convert the exponent to 8-bit excess-127 notation
Add 127 to the exponent and convert it to 8-bit binary:
5 + 127 = 132--> 10000100
Step 4: Convert the mantissa/significand to "hidden bit" format.
Since every binary floating-point number (except zero!) is normalized with "1." at the start, there is no need to store that leftmost "1".
Remove the leading "1." from the mantissa/significand:
1.0001110 --> 0001110
Step 5: Write down the 1+8+23 = 32 bits.
35.25 is positive - the sign bit is zero: 0
The next eight bits are the exponent: 10000100
Binary result (32 bits): 0100001000011100000000000000000