Write a program to compare double precision floating point v. single precision floating point v. 32-bit integer v. 8-bit integer calculations (+, -, *, /). Keep the operands simple so the processor uses just registers (no arrays). Take care that you do the same number and type of operations and that you don't create dependencies in your code that hang up a superscalar architecture (see next task). Think carefully about how to do this so that the instrustructure (e.g. a for loop) does not play a significant role (> 20%) in the computation numbers. Given that double and single precision floating point operations take up more memory than 8 or 16-bit integer operations, we expected the integer operations to be quicker. The integer operations were quicker than the floating point operations with the single precision being slightly faster than the double precision floating point operations. What we didn't expect was that the 8-bit integer operations would be slower than the 32-bit integer operations. We thought that smaller would be quicker in every case but since the processors in the machines were were using were better geared for 32-bit operations, the 32-bit integers were faster.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||