Digital Arithmetic
65
Table 3.9 Example 3.11
1
1 0 1 0 0 0 1
Divisor less than dividend
−1 0 0 1
0 0 0 1
0
0 0 0 1 0
Divisor greater than dividend
−1 0 0 1
0
0 0 0 1 0 0
Divisor still greater
−1 0 0 1
1
0 0 0 1 0 0 1
Divisor less than dividend
−1 0 0 1
0 0 0 0 0 0 0
For example, if the exponents of the two numbers are not equal, the addition and subtraction operations
necessitate that they be made equal. In that case, the mantissa of the smaller of the two numbers is
shifted right, and the exponent is incremented for each shift until the two exponents are equal. Once the
binary points are aligned and the exponents made equal, addition and subtraction operations become
straightforward. While doing subtraction, of course, a magnitude check is also required to determine
the smaller of the two numbers.
3.7.1 Addition and Subtraction
If N 1 and N 2 are two floating-point numbers given by
N 1 = m 1 × 2
e
N 2 = m 2 × 2
e
then
N 1 + N 2 = m 1 × 2
e + m 2 × 2
e = m 1 + m 2 × 2
e
and
N 1 − N 2 = m 1 × 2
e − m 2 × 2
e = m 1 − m 2 × 2
e
The subtraction operation assumes that N 1 > N 2 . Post-normalization of the result may be required
after the addition or subtraction operation.
3.7.2 Multiplication and Division
In the case of multiplication of two floating-point numbers, the mantissas of the two numbers are
multiplied and their exponents are added. In the case of a division operation, the mantissa of the
65
Table 3.9 Example 3.11
1
1 0 1 0 0 0 1
Divisor less than dividend
−1 0 0 1
0 0 0 1
0
0 0 0 1 0
Divisor greater than dividend
−1 0 0 1
0
0 0 0 1 0 0
Divisor still greater
−1 0 0 1
1
0 0 0 1 0 0 1
Divisor less than dividend
−1 0 0 1
0 0 0 0 0 0 0
For example, if the exponents of the two numbers are not equal, the addition and subtraction operations
necessitate that they be made equal. In that case, the mantissa of the smaller of the two numbers is
shifted right, and the exponent is incremented for each shift until the two exponents are equal. Once the
binary points are aligned and the exponents made equal, addition and subtraction operations become
straightforward. While doing subtraction, of course, a magnitude check is also required to determine
the smaller of the two numbers.
3.7.1 Addition and Subtraction
If N 1 and N 2 are two floating-point numbers given by
N 1 = m 1 × 2
e
N 2 = m 2 × 2
e
then
N 1 + N 2 = m 1 × 2
e + m 2 × 2
e = m 1 + m 2 × 2
e
and
N 1 − N 2 = m 1 × 2
e − m 2 × 2
e = m 1 − m 2 × 2
e
The subtraction operation assumes that N 1 > N 2 . Post-normalization of the result may be required
after the addition or subtraction operation.
3.7.2 Multiplication and Division
In the case of multiplication of two floating-point numbers, the mantissas of the two numbers are
multiplied and their exponents are added. In the case of a division operation, the mantissa of the
