Computer Arithmetic 73
We continue our scanning from left to right and next encounter with the left most two digits of the
dividend, i.e., 01 (underlined). Again it is found to be less than the divisor, which forces us to add
another zero in the quotient [Figure 4.14 (c)]. As we continue our scanning, we next meet with 010 part
of the dividend (its three leading digits) and nd that it is equal (even greater would do) to the divisor.
At this point, we may add a 1 in the place of quotient, making it 001, write the divisor below the divi-
dend and perform a subtraction. The remainder in this case is 000. We then write the next considerable
digit of the dividend, i.e., 1 at the right side of the remainder [shown by a vertical downward arrow in
Figure 4.14 (d)].
As the last step, we nd that the present remainder 0001 is less than divisor. Therefore, we add another
zero with the quotient making it 0010 and complete our process. Thus, nally, we get a quotient of 0010
(2 in decimal) and a remainder 0001 (1 in decimal) by our process, matching with our expectations.
An algorithm may be developed for the above method to divide unsigned integers. However, this
method would not be applicable for signed integers, expressed in two’s complement form. For that pur-
pose, we have to adopt another algorithm (William Stallings, 2009), as described below.
4.6 DIVISION OF SIGNED INTEGERS
Just like Booth’s algorithm for multiplication of signed binary integers, the division algorithm also uses
several locations. In this case, a joint left-shift of two locations has to be performed. In the following
sub-sections we describe all relevant details, discuss about the algorithm and then solve a few examples
using this algorithm.
4.6.1 Locations and Counters
To implement this algorithm for division of signed integers, we would need four locations; all should be
n -bit wide, where ‘ n ’ is the number of bits being considered for divisor and dividend. In other words, for
4-bit numbers, we shall need 4-bit wide locations, for 8-bit numbers, we shall need 8-bit wide locations
and so on. We designate these four locations as V, R, D and C, as indicated in Figure 4.15 .
Figure 4.15 Locations involved for division algorithm
Location V, is to contain n -bit divisor. If the divisor is negative, its two’s complement form should
be loaded in V. We shall only use its content, which would remain unchanged till the completion of the
process. Location C is the n -bit down counter and initially to be loaded by n . At the end of every cycle, C
would be decremented by 1. The operation of division would be complete when C becomes 0. The n -bit
dividend must be expanded to 2 n -bit form and be loaded in locations R and Q, where R would contain
M04_GHOS1557_01_SE_C04.indd 73M04_GHOS1557_01_SE_C04.indd 73 4/29/11 5:04 PM4/29/11 5:04 PM