Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions