Question: unsigned int obtainMantissa (float f ) { int bitPattern = (unsigned int*)&f; // YOUR CODE HERE } 3. Bit Manipulation and Floating Point Representation (10

 unsigned int obtainMantissa (float f ) { int bitPattern = (unsigned

unsigned int obtainMantissa (float f )
 { int bitPattern = (unsigned int*)&f; 
 // YOUR CODE HERE 

}

3. Bit Manipulation and Floating Point Representation (10 points): (10 Points) IEEE single preceision float point notation is: most sig. SEEE, EEEE EMMM, MMMM MMMM,MMMM MMMM, MMMM least sig. where: S = sign bit (0 = positive, 1 = negative) o EEEE,EEEE are the exponent bits: Bit pattern (EEEE,EEEE) Power of 2 2 0111,1101 0111,1110 2 1000,0000 1000,0001 0 2 2 2 o MMM,MMMM MMMM,MMMM MMMM,MMMM are the mantissa bits (with the highest 1 bit, the "hidden bit", not stored) Finish the function obtainMantissa(float f) that returns the mantissa field of f as an unsigned integer. This integer should have the hidden-bit turned on only if the exponent field is not all zeros. unsigned int obtainMantissa (float int bitPattern (unsigned int*)&f ; // YOUR CODE HERE 3. Bit Manipulation and Floating Point Representation (10 points): (10 Points) IEEE single preceision float point notation is: most sig. SEEE, EEEE EMMM, MMMM MMMM,MMMM MMMM, MMMM least sig. where: S = sign bit (0 = positive, 1 = negative) o EEEE,EEEE are the exponent bits: Bit pattern (EEEE,EEEE) Power of 2 2 0111,1101 0111,1110 2 1000,0000 1000,0001 0 2 2 2 o MMM,MMMM MMMM,MMMM MMMM,MMMM are the mantissa bits (with the highest 1 bit, the "hidden bit", not stored) Finish the function obtainMantissa(float f) that returns the mantissa field of f as an unsigned integer. This integer should have the hidden-bit turned on only if the exponent field is not all zeros. unsigned int obtainMantissa (float int bitPattern (unsigned int*)&f ; // YOUR CODE HERE

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!