Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using C# or Java; Write a program which correctly calculates add, subtract, multiply and divide for our minifloat binary format using an algorithm you code

Using C# or Java;

Write 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 needs to work on two numbers at a time. For each number store the sign, exponent and mantissa separately. You can hard code your examples.

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), but I would keep the 1. Stored explicitly, so it becomes 0-15 and 4 digits long.

}

Show testing for all 4 (add, sub, mul, div) with at least 3 examples.

Make sure you are error checking for NAN and +/- 0.

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

The Database Experts Guide To SQL

Authors: Frank Lusardi

1st Edition

0070390029, 978-0070390027

More Books

Students also viewed these Databases questions