Question: Given an 8 - bit floating point number in the format: 8 total bits 3 bit exponent bias of 3 denormal encodings supported Implement the

Given an 8-bit floating point number in the format:
8 total bits
3 bit exponent
bias of 3
denormal encodings supported
Implement the following function in C, which returns the corresponding 32-bit floating point number in the format:
32 total bits
8 bit exponent
bias of 127
denormal encodings supported
(this shouldn't matter outside of the two special cases of 0, your output should never otherwise have an exponent of all zeros)
You can handle both the normal and denormal cases separately, and both should be doable using bitwise operations without ever getting back the decimal representation of the number. Your input will be in the bottom 8 bits of the fp parameter.
Fill in the following starter code. Keep the same function name unsigned int fp_convert(...). Make sure any variables you define are of type unsigned int to avoid issues with shifting two's complement values.

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 Programming Questions!