16
DECIMAL DIVISION IMPLEMENTATION USING VHDL

Decimal Division Implementation Using Vhdl

Embed Size (px)

DESCRIPTION

Final Year project

Citation preview

Page 1: Decimal Division Implementation Using Vhdl

DECIMAL DIVISION IMPLEMENTATION USING

VHDL

Page 2: Decimal Division Implementation Using Vhdl

Several algorithms exit to perform division in digital domain.

These algorithms fall in two main categories:-

Slow divisionFast division

ALGORITHMS:

Page 3: Decimal Division Implementation Using Vhdl

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

Slow division algorithm

Page 4: Decimal Division Implementation Using Vhdl

This algorithm depends on the following assumptions:

D < N 0 < N,D < 1 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}.

DIGIT RECURRENCE RESTORING DIVISION:

Page 5: Decimal Division Implementation Using Vhdl
Page 6: Decimal Division Implementation Using Vhdl

Algorithm for restoring division

P := XD := D << n * P and D need twice the word width of X and Qfor 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 endend

X=numerator , D=denominator, n=#bits, P=Partial remainder, q(i)=bit #i of quotient

Page 7: Decimal Division Implementation Using Vhdl
Page 8: Decimal Division Implementation Using Vhdl

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}

DIGIT RECURRENCE NONRESTORING DIVISION:

Page 9: Decimal Division Implementation Using Vhdl

algorithm for non-restoring division

P[0] := N i := 0while 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 + 1end while

Page 10: Decimal Division Implementation Using Vhdl

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.

SRT DIVISION:

Page 11: Decimal Division Implementation Using Vhdl
Page 12: Decimal Division Implementation Using Vhdl
Page 13: Decimal Division Implementation Using Vhdl
Page 14: Decimal Division Implementation Using Vhdl

Fast division algorithm include 1.Newton –Raphson Method 2. Gold schimdt Method

Fast division algorithms:

Page 15: Decimal Division Implementation Using Vhdl

Newton-Raphson iteration provides a high-speed method for performing division.

To perform the division Q = Y/X, an initial approximation to the divisor’s 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.

NEWTON RAPHSON METHOD:

Page 16: Decimal Division Implementation Using Vhdl

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.

0 < D < 1 then Fi + 1 = 2 − Di

GOLD SCHMIDT DIVISION METHOD: