Page 96 - Engineering Digital Design
P. 96
2.9 BINARY ARITHMETIC 67
k { = 1 + (D sko) 2c = 1.00100100 • • • 00
Dskoki =.1 111101011 1100- • -00
k 2 = l+(D sk 0k]) 2C = 1.00000101000100- • -00
D sk 0kik 2 = .11111111111001100101111
= 1.00000000000110011010001.
After four iterations the quotient is given by
3
Q = (D Dk 0k {k 2k 3) = .11100110011001100011000 x 2 ,
which is truncated to 23 bits. The quotient has a decimal value of
3
(0.899996755 x 2 ) 10 = 7.1999740450,0.
In normalized FPN signed-magnitude 32 bit form the quotient is given by
Q= 1 10000010 11001100110011000110000,
where the MSB 1 bit of the mantissa has been omitted as discussed in Section 2.8. Note
that the subtraction of exponents E x - E Y is 130 - 127 = 003 10 or 1 00000 10 2 in excess
127 code. The sign bits are added in binary giving Sx + Sy =0+ 1 = 1, where any carry
(in this case 0) is discarded.
Algorithm 2.16: Signed-Magnitude (X x Y) FPN or (X -f- Y) FPN
(1) Set operands X and F in IEEE normalized FPN form (see Section 2.7).
(2) Add the exponents EX and E Y according to Algorithms 2.8 or 2.9,
(3) If X x 7, then multiply mantissa fractions according to Algorithm 2.10.
(4) If X ~ K, then divide mantissas according to Algorithm 2.13.
(5) Add the sign bits Sx + Sy and discard the carry.
(6) Set result in IEEE normalized FPN form.
2.9.8 Perspective on Arithmetic Codes
It should seem clear to the reader that certain arithmetic operations are more easily executed
than others, depending on whether or not the operands are signed and depending on the
number code used to carry out the operation. Table 2.9 is intended to show the general
degree of difficulty of certain arithmetic operations relative to the arithmetic code (signed-
magnitude, 2's complement, etc.) used.
Not indicated in Table 2.9 are the subdivisions within a given type of arithmetic operation.
For example, no distinction is made between a direct division (restoring) algorithm and an
iterative divide (nonrestoring) algorithm, which may differ significantly with regard to dif-
ficulty — the latter being easier for operands represented in FPN notation. As a general rule,