本文在分析软件算法和硬件实现的不同特点的基础上,结合C语言算法和HDL硬件实现的特点,提出了将C算法转换为HDL实现的一种改进方法。通过求最大公因数的例子,说明了改进前后的方法在资源利用和最大工作频率方面的差距并不是很明显,但改进后的方法比改进前的方法简洁实用,易于理解和操作。本文提出的改进方法优势明显,具有更广泛的应用前景,对于一般C语言算法的硬件实现具有适用性和指导意义。
Based on analyzing the difference between C language algorithm and HDL hardware implementation, an improved method for transforming C language algorithm to HDL hardware implementation was put forward. We demonstrated the application and advantages of this method through an example for solving ged. The method proposed in this article not only has many advantages and widely application, but also offers good guidance to transform C language algorithm to HDL hardware implementation.