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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started