Limited Offer Get 25% off — use code BESTW25
No AI No Plagiarism On-Time Delivery Free Revisions
Claim Now
Prices start at $5 per page · plagiarism-free papers · free revisions for 14 days 24/7 support: support@bestwriters.com
Uncategorized

In C# or Java (I don’t care which) write a program which correctly calculates add, subtract, multiply and divide using our ‘minifloat’ binary format using an algorithm you code yourself (see below)

  • Posted
  • Authoradmin
  • Length172 words
  • Reading time1 min
Write My Assignment FREE

In C# or Java (I don’t care which) write a program which correctly calculates add, subtract, multiply and divide using our ‘minifloat’ binary format using an algorithm you code yourself (see below)

Your program only needs to work on two ‘numbers’ at a time, read those in from a text file.   For each ‘number’ store the sign, exponent and mantissa separately.  You can hard code your examples.

E.g.

Struct minifloat{

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 (and compare to results you do by hand).

Make sure you are 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.

Plagiarism Free Assignment Help

Expert Help With This Assignment — On Your Terms

✓ Native UK, USA & Australia writers ✓ Deadline from 3 hours ✓ 100% Plagiarism-Free — Turnitin included ✓ Unlimited free revisions ✓ Free to submit — compare quotes

admin

Academic writer and editor at BestWriters.

Get your paper off your plate tonight

Post your instructions for free. Prices start at $5 per page.

Place an order