Question: Using the C datatype typedef unsigned int bit32; and the print function int printhex(bit32 x){ printf(%.8x, x)} a) Write a C function to extract the

Using the C datatype

typedef unsigned int bit32;

and the print function

int printhex(bit32 x){

printf("%.8x", x)}

a) Write a C function to extract the sign, exponent, and fraction of a bit32 floating point number, returning their respective values and unsigned integers.

b) Write a function, float_32(unsigned int sign, unsigned int exp, unsigned in frac) that returns a bit32 representation of a number given a sign, exponent, and fraction vales as unsigned integers.

c) Using the functions defined in (a) and (b), write a function fp_add(bit32 x, bit32 y) that returns the addition of two bit32 values x and y as a floating point bit32 value

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!