Page 280 - ARM 64 Bit Assembly Language
P. 280
Non-integral mathematics 269
necessity, need to limit the number of bits used. Since the ARM processor provides a multi-
ply instruction involving two 32-bit numbers, we choose to truncate the numerators to 32 bits.
The third column in the table indicates the resulting format for each term if precision is lim-
itedto32bits.
On further consideration of the Taylor series, we notice that each of the above terms will be
divided by a constant. Instead of dividing, we can multiply by the reciprocal of the constant.
We will create a similar table holding the formats and constants for the factorial terms. With
a bit of luck, the division (implemented as multiplication) in each term will result in a reason-
able format for each resulting term.
8.6.2 Formats and constants for the factorial terms
The first term of the Taylor series is x , so we can simply skip the division. The second term is
1!
x 3 3 1 x 5 5 1 1
− = x ×− and the third term is = x ×− We can convert − to binary as follows:
3! 3! 5! 5! 3!
Multiplication Result
Integer Fraction
1 × 2 = 2 0 2
6 6 6
2 4 0 4
6 × 2 = 6 6
4 × 2 = 8 1 2
6 6 6
2 4 0 4
6 × 2 = 6 6
8 × 2 = 8 1 2
6 6 6
Note that the fraction in the fifth row of the table is the same as the fraction in the third row
of the table. Since the pattern repeats, we can conclude that 1 = 0.001 2 . Since we need a
3!
1
negative number, we take the two’s complement, resulting in − = ...111.110 2 . The fraction
3!
1 can be represented as an S(1,33), as shown below:
3!
Since the first four bits are one, we can remove three bits and store it as: