Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I implement floating point IEEE754 division in 68k assembly or in general?

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?

like image 790
Steve Avatar asked Nov 29 '25 21:11

Steve


1 Answers

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

like image 185
GJ. Avatar answered Dec 01 '25 16:12

GJ.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!