论文部分内容阅读
旨在提高89C51系列单片机编程中经常用到的整数二—十进制转换的代码执行效率。提出的快速算法思路是,首先求出整数中包含的1000的个数,方法是采用二进制整数的高6位作为其预估,再通过2次校正得到准确值。算法的关键是充分利用89C51单片机的两条特殊指令——单字节乘和单字节除。其耗费时间不及使用sprintf()函数的1/10。
Designed to improve 89C51 series microcontroller programming often used integer two - decimal conversion code execution efficiency. The idea of fast algorithm proposed is to first find the number of 1000 contained in the integer by using the upper 6 bits of the binary integer as its estimate and then the correct value by 2 corrections. The key of the algorithm is to make full use of two special instructions of 89C51 one-chip computer - single byte multiplication and single byte divide. It takes less than a tenth of the time to use the sprintf () function.