AvadheshDixitLecture 14 ComputerOrganisation
AvadheshDixitLecture 14 ComputerOrganisation
Division is somewhat more complex than multiplication but is based on the same general
principles. As before, the basis for the algorithm is the paper-and-pencil approach, and the
operation involves repetitive shifting and addition or subtraction. Following Figure shows an
example of the long division of unsigned binary integers. It is instructive to describe the
process in detail. First, the bits of the dividend are examined from left to right, until the set
of bits examined represents a number greater than or equal to the divisor; this is referred to
as the divisor being able to divide the number. Until this event occurs, 0s are placed in the
quotient from left to right. When the event occurs, a 1 is placed in the quotient and the
divisor is subtracted from the partial dividend. The result is referred to as a partial
remainder
From this point on, the division follows a cyclic pattern. At each cycle, additional bits from
the dividend are appended to the partial remainder until the result is greater than or equal
to the divisor. As before, the divisor is subtracted from this number to produce a new partial
remainder. The process continues until all the bits of the dividend are exhausted. In Figure
shows a machine algorithm that corresponds to the long division process. The divisor is
placed in the M register, the dividend in the Q register. At each step, the A and Q registers
together are shifted to the left 1 bit. M is subtracted from A to determine whether A divides
the partial remainder.3 If it does, then Q0 gets a 1bit. Otherwise, Q0 gets a 0 bit and M must
be added back to A to restore the previous value. The count is then decremented, and the
process continues for n steps. At the end, the quotient is in the Q register and the remainder
is in the A register. This process can, with some difficulty, be extended to negative numbers.
We give here one approach for twos
complement numbers.
Example 7/3