Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you help me, please With C programming, please? In this C programming, we need to convert the float number which it is 32 bits

Can you help me, please WithC programming,please? In this C programming, we need to convert the float number which it is 32 bits to a mini float that has 8 bits .using the first bit for the sign,3 numbers for the exponent, 4 numbers for the sig fix. I have an idea about using the bitwise shifting to get these however I got into nowhere please help. I add the skeleton for the code.

#include \"minifloat.h\"

Minifloat from_float(float a) { Minifloat mf; // convert a to mf return mf; }

Minifloat from_char(char *a) { Minifloat mf; // convert a to mf return mf; }

Minifloat add(Minifloat a, Minifloat b) { Minifloat result;

// do the computation

return result; }

Minifloat mul(Minifloat a, Minifloat b) { Minifloat result;

// do the computation

return result; }

Minifloat sub(Minifloat a, Minifloat b) { Minifloat result;

// do the computation

return result; }

Minifloat Divide(Minifloat a, Minifloat b) { Minifloat result;

// do the computation

return result; }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Professional Android 4 Application Development

Authors: Reto Meier

3rd Edition

1118223853, 9781118223857

More Books

Students also viewed these Programming questions

Question

=+creating a potentially dangerous situation for an airline?

Answered: 1 week ago

Question

=+b. Calculate the values of the sample mean and median.

Answered: 1 week ago