Part 3-Division Algorithms
Part 3-Division Algorithms
Module 2
Topics Covered
• Restoring Division
• Non-Restoring Division
Division
• Division process for binary numbers is similar to decimal
numbers.
• In the division process, first the bits at dividend are examined
from left to right, until the set of bits examined represents a
number greater than or equal to the divisor.
• Until this condition occurs,0’s are placed in the quotient from
left to right.
• When the condition is satisfied, a 1 is placed in the quotient and
the divisor is subtracted from the partial dividend. The result is
referred to as a partial reminder.
Division -Example
Terms
• Dividend
A number being divided.
• Divisor
A number that the dividend is divided by.
• Quotient
The primary result of a division; a number that when
multiplied by the divisor and added to the remainder produces
the dividend.
• Remainder
The secondary result of a division; a number that when
added to the product of the quotient and the divisor produces the
dividend.
Dividend = (Divisor x Quotient)+ Remainder
Restoring Division
• An n-bit positive divisor is loaded into register M and an n-bit positive dividend.
is loaded into register Q at the start of the operation.
• Register A is set to 0. After the division is complete, the n-bit quotient is in register Q and the remainder is in
register A.
• The required subtractions are facilitated by using 2’s-complement arithmetic.
• The extra bit position at the left end of both A and M accommodates the sign bit during subtractions.
Flow Chart – Restoring Division
Restoring Division
Restoring Division
• Divisor and Dividend are loaded into M and Q register.
• Register A is initially set to 0 and n = number of bits in dividend
• After the division process is completed, n-bit Quotient is in register Q
and the remainder is in A
Restoring Division
• Step involved:
• Step1 : Shift left A and Q left one binary position
• Step 2: Subtract divisor (i.e add 2’s complement of divisor(M)) from A
and place the answer in A(AA-M)
• Step 3:If the sign bit of A is 1, set q0 to 0 and add divisor back to
A(restore A), otherwise set q0 to 1.
• Step 4: Repeat steps 1, 2 and 3 for n times
Non Restoring Division
• If A is positive, we shift left and subtract M, that is, we perform 2A −
M.
• If A is negative, we restore it by performing A + M, and then we shift it
left and subtract M. This is equivalent to performing 2A + M.
(i.e.,2(A+M)-M)
• The q0 bit is appropriately set to 0 or 1 after the correct operation has
been performed. We can summarize this in the following algorithm
for non-restoring division.
Non Restoring Division
Non-Restoring
Division