3
votes

I have to create a floating point implementation for a 68k processor in IEEE754 format, and I've figured out how to do all the other basic operations (conversion from decimal, addition, subtraction, multiplication), but I can't figure out how to do division. From my understanding, you're supposed to divide the mantissas and then subtract the exponents. However, if you divide the mantissas, you get ANOTHER floating point, and that's definitely not what I want nor can use (since the only division function the 68k processor provides shows the result of integer division, and the modulus remainder answer).

Can anyone provide an example of how to do this kind of division on a 68k processor, or in general with my limitations?

1
You can look at other software float implementations, such as SoftFloat - jhauser.us/arithmetic/SoftFloat.html - LiraNuna
Thanks, this looks pretty helpful. Just gotta work my way through the functions :) - Steve

1 Answers

3
votes

Here you can find exact algorithems and explanations for IEEE 754 floating point math...

  • float to integer conversion

  • integer to float conversion

  • normalize

  • add/subtract

  • multiply

  • divide

    ...unfortunately not for 68k CPU, however algorithems are the same.

Here you have a flowchard for 24 bit FP divide a = a / b :

enter image description here