This is Machine Architecture! ***WRITE THE CODE ON YOUR OWN*** Create a MIPS program that demonstrates that the associative law fails in addition for floating point numbers (single or double precision). You only need to demonstrate it for single precision. Remember the associative law is a + (b + c) = (a + b) + c.
This is Machine Architecture!
***WRITE THE CODE ON YOUR OWN***
Create a MIPS
The program’s output should look something like the following where the xxx’s are the numbers you chose. The resulting numbers may be different than mine depending on your choice of a, b, and c.
Using a = xxx, b = xxx, and c = xxx
a + (b + c) = 0
(a + b) + c = 1
The key is to have two of the number large (one positively and one negatively but equal in magnitude) floating point numbers and the third floating point number very small in comparison.
As a side note, the associative law will also fail for multiplication for floating point numbers, but you do not need to demonstrate that.
Please don't forget to include comments in this code
Step by step
Solved in 2 steps