write my assignment 7108

In a sensible language ( any of C/C++/C#/Java/Python or similar) create a program which correctly calculates add, subtract, multiply and divide for our minifloat binary format using an algorithm you code yourself. Some details:

Your program only to work on two ‘numbers’ at a time. For each ‘number’ store the sign, exponent (4 bits) and mantissa separately.

E.g.

Struct miniflaot{

Int sign; // sign, actually 1 bit

Int exponent; // this is the exponent and is 4 bits long (0-15)

Int mantissa; //this is the fraction part and is 3bits long (0-7)

}

Show testing for all 4 (add, sub, mul, div) with at least 3 examples. Ignore error checking for NAN and +/- 0. 

Note: This is an obviously contrived example, the intent is to force you to think about the algorithm, not to make software that anyone would ever want to use.  

 
"Not answered?"
Get the Answer