Decimal Division Implementation Using VHDL
Decimal Division Implementation Using VHDL
Decimal Division Implementation Using VHDL
These algorithms fall in two main categories: Slow division Fast division
Slow division algorithms produce one digit of the final quotient per iteration. Slow division methods are all based on a standard recurrence equation:
Pj = the partial remainder of the division R = the radix q n-( j + 1) = the digit of the quotient in position n-(j+1)
Slow division algorithm include 1.Digit Recurrence Restoring 2. Digit Recurrence Non-restoring and 3 . SRT division
Divisor is subtracted from dividend. If the result of subtraction is negative it rolls back by adding divisor and the step is called Restoring. The quotient digits q are formed from the digit set {0,1}.
P := X D := D << n * P and D need twice the word width of X and Q for i = n-1..0 do * for example 31..0 for 32 bits P := 2P - D * trial subtraction from shifted value if P >= 0 then q(i) := 1 * result-bit 1 else q(i) := 0 * result-bit 0 P := P + D * new partial remainder is (restored) shifted value end end X=numerator , D=denominator, n=#bits, P=Partial remainder, q(i)=bit #i of quotient
The above restoring division algorithm can avoid the restoring step by saving the shifted value 2P before the subtraction in an additional register T and copying register T to P when the result of the subtraction 2P - D is negative. Non-restoring division uses the digit set {1,1} for the quotient digits instead of {0,1}
P[0] := N i := 0 while i < n do if P[i] >= 0 then q[n-(i+1)] := 1 P[i+1] := 2*P[i] - D else q[n-(i+1)] := -1 P[i+1] := 2*P[i] + D end if i := i + 1 end while
Named after its inventors Sweeney, Robertson and Tocher. SRT division is similar to non-restoring division, but it uses a lookup table based on the dividend and the divisor to determine each quotient digit. SRT division is popular method for division in many microprocessor implementations.
Fast division algorithm include 1.Newton Raphson Method 2. Gold schimdt Method
Newton-Raphson iteration provides a highspeed method for performing division. To perform the division Q = Y/X, an initial approximation to the divisors reciprocal, R0 1/X is made. Next, m Newton-Raphson iterations are performed to produce an improved reciprocal approximation, Rm. The dividend, Y is then multiplied by Rm to obtain an approximate quotient, Q_, which is adjusted and rounded to obtain the the final quotient, Q.
This method uses an iterative process to repeatedly multiply both the dividend and divisor by a common factor Fi to converge the divisor, D, to 1.