为解决Keil C51环境下无法进行64位双精度计算的问题,采用分部存储和分部计算的方法,设计了在Keil C51环境下符合IEEE-754标准的64位浮点库.程序用C51语言实现,具有很强的可移植性.在浮点库设计完成后编写了测试代码进行耗时测试,测试中加法运算耗时低于5 ms,乘除法运算耗时低于40 ms,结果表明,可以满足绝大多数实时性要求不高的工程需要,降低了工程的设计门槛和开发成本,为8051核系列单片机提供了更广泛的应用空间.
The Keil C51 can't provide the 64bits floating-point calculation. In order to solve this prob- lem, using the method of branch store and division calculation, a 64bits floating-point library is designed which is conform to the IEEE-754 standard. The library is programmed by C51 language, which has very strong portability. After the programming of the floating-point library, a time-consuming test had execu- ted. In the test, the addition operation time-consuming is less than 5 milliseconds, multiplication operation and division operation time-consuming is less than 40 milliseconds. The results show that the floating- point library can be used in a vast majority of engineering development while the real-time requirement is not very strong. The library can reduce the design threshold and the development cost in the engineering development, and it provides a broader space for the application of the MCUs based on 8051 kernel.