[This page is auto-generated; please prefer to read the article’s PDF Form.]
When we perform long-division manually for decimal numerals, we usually depend on trial-and-error to find a quotient-digit d. If the IDD is less than the divisor, d is simply 0. Otherwise, we can make a guess about d based on some initial digits of the divisor and the IDD. Then we need to multiply guess d with the divisor to check if the guess is correct. If incorrect, we make another guess and so on. In our earlier example, for IDD 1349, the guess of d = 4, based simply on 13∕3 (13 from 1349, 3 from 365) is incorrect (365 ⋅ 4 = 1460 exceeds 1349) and needs another try with d = 3.
We need to make this trial-and-error method efficient (requiring less number of corrections) and well-defined, for any base B numeral system. We will be discussing a method proposed by Pope and Stein in [3], which is also described in Knuth’s book [4] (section Multiple Precision Arithmetic). To guess d, it uses the first digit of b and first two digits of the IDD (which, as mentioned earlier, is treated as having width nb + 1).
A variant of this method which uses first two digits of b and first three digits of the IDD has been discussed by Hansen in [5], which is also a good resource on this topic. The theorems behind this variant have been attributed to Krishnamurthy and Nandi [6].
Let us denote the IDD of some iteration by x = (xnbxnb−1…x1x0), where xnb, xnb−1 etc may be 0. In favor of simpler symbols, we will denote xnb,xnb−1 as y,z and bnb−1 (the MSD of b) as e. The 2-digit number formed by y and z will be denoted as (yz).
Before we proceed further, we will make some observations about multiplication of b by a single digit s, that will help us in the discussion below. Such multiplication will be referred as “multiplication bs{s = …}” with s as specified.
We can use the schoolbook’s multiplication method to help us understand this:
|
Please refer to article [2], section “Multiplication by a Digit”, Lemma 2. The digits u, v at positions nb, nb−1 of the result, will together form a number (uv) as given by (cnb−2 is the carry from earlier position):
| (2) |
So,
| (3) |
Also, due to Lemma 1 in article [2], any carry cannot exceed (s − 1). So,
| (4) |
Whenever we will need to compare bs (for any digit s) with the IDD x, we can first ignore their last nb − 1 digits and simply compare the values formed by their two most significant digits: (uv) and (yz). Then we can use:
Copyright © 2021 Nitin Verma. All rights reserved.