摘要
TMS320F2812是目前控制领域先进的定点处理器之一,它有着大量地应用。然而,当其面临浮点运算时,往往会耗费更多的资源,使运算时间增加。使用Q格式,将浮点数采用定点表示,可缩短运算时间。但是,采用定点格式表示的数在范围与精度上存在矛盾,使得程序变得复杂,通用性低。正基于此,TI公司提供了IQmath库,利用该库中的函数,使运算速度快于标准C语言的浮点运算,同时具有可读性强及编程简单的特点。在介绍IQmath的基础上,以一个已经运用于实际的坐标解算程序为例,体现基于IQmath编程的优点。
TMS320F2812 is the advanced fixed-point processor, which has widely used in the control area. However, when it meets float-point calculation, it will cost more resource of the hardware, making the calculation time longer. By means of Q format, the float-point data could be expressed by the fixed-point data. It will shorten the calculation time. But, when using fixed-point, the data’s range and precision have a conflict, and making the program more complicated. On the basis of that,TI Company provided IQmath library, using the function in that library, making it calculate faster than the standard C float-point’s. In addition, it has characteristic of readable and easily etc. After introducing IQmath, taking Coordinates Conversion Arithmetic as an example to present IQmath’s virtue.
出处
《电脑开发与应用》
2014年第8期50-52,55,共4页
Computer Development & Applications