如何实现在没有除法的硬件二进制浮点除法和无浮点硬件 [英] How to implement floating point division in binary with no division hardware and no floating point hardware

查看:168
本文介绍了如何实现在没有除法的硬件二进制浮点除法和无浮点硬件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何实现IEEE-754 32位单precision浮点除法在没有除法的硬件二进制和没有浮点硬件?

I am wondering how to implement IEEE-754 32-bit single precision floating point division in binary with no division hardware and no floating point hardware?

我已经转向硬件,加,减,乘。

I have shifting hardware, add, subtract, and multiply.

我已经执行浮点乘法,加法,并使用16位字减法。

I have already implemented floating point multiplication, addition, and subtraction using 16-bit words.

我在一个专用的多核处理器执行这些指令和汇编写我的code。在此之前,我使用MATLAB来验证我的算法。

I am implementing these instructions on a proprietary multicore processor and writing my code in assembly. Beforehand, I am using matlab to verify my algorithm.

我知道我需要减去的指数,但我怎么对尾数执行无符号除法?

I know I need to subtract the exponents, but how do i perform unsigned division on the mantissas?

推荐答案

取决于你想多么复杂,使之。保持它相当简单的,你可以通过倒数近似值尝试分工。

Depends on how complicated you want to make it. Keeping it reasonably simple, you could try division by reciprocal approximation.

而不是计算:(N / D)你锻炼:N *(1 / D)

Rather than calculating: (n / d) you'd work out: n * (1 / d).

要做到这一点你需要使用一些方法来制定的倒数,例如,的牛顿迭代它使用牛顿的方法来计算除数,直到它的倒数先后更加准确的估计

To do this you'd need to work out the reciprocal using some method, for example, Newton-Raphson which uses Newton's method to calculate successively more accurate estimates of the reciprocal of the divisor until it's "adequately" accurate for your purpose before doing the final multiplication step.

修改

刚刚看到您的更新。今年五月,或毕竟可能不是,对您有用!

Just seen your update. This may, or may not, be useful for you after all!

这篇关于如何实现在没有除法的硬件二进制浮点除法和无浮点硬件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆