四柱漢諾塔問(wèn)題的求解程序.解題思路:如a,b,c,d四柱. 要把a(bǔ)柱第n個(gè)盤(pán)移到目標(biāo)柱子(d柱),先把上層
分兩為兩部份,上半部份移到b柱,下半部分移到c柱,再把第n盤(pán)移到
目標(biāo)柱子,然后,c柱盤(pán)子再移到目標(biāo)柱子,再把b柱盤(pán)子移到目標(biāo)柱子.
細(xì)節(jié)地方:
上半部份移到b柱時(shí),它的中間變量柱子是有二選一的.而下半部分
移到c柱時(shí),它的中間變量柱子只有一個(gè)(因?yàn)橐粋€(gè)柱子已被上半部份
占了).b,c也移到目標(biāo)柱子時(shí)同理。
標(biāo)簽:
分
漢
程序
上傳時(shí)間:
2013-12-22
上傳用戶:aeiouetla
Verilog HDL: Magnitude
For a vector (a,b), the magnitude representation is the following:
A common approach to implementing these arithmetic functions is to use the Coordinate Rotation Digital Computer (CORDIC) algorithm. The CORDIC algorithm calculates the trigonometric functions of sine, cosine, magnitude, and phase using an iterative process. It is made up of a series of micro-rotations of the vector by a set of predetermined constants, which are powers of two. Using binary arithmetic, this algorithm essentially replaces multipliers with shift and add operations. In a Stratix™ device, it is possible to calculate some of these arithmetic functions directly, without having to implement the CORDIC algorithm.
標(biāo)簽:
representation
Magnitude
the
magnitude
上傳時(shí)間:
2013-12-24
上傳用戶:金宜