(1) Mathematical Principles:
Two number of original code multiplied , the product of the symbol is multiplied by two number of symbols of the XOR value , the value is equal to the product of the absolute value of two.
Assume [X] original =x0.x1x2. Xn ,
Y Original =y0. Y1y2. Yn,
Then there are: [X· Y] Original = (X0⊙Y0). [(x1x2. Xn)· (y1y2. Yn)]
(2) algorithm:
Suppose x=0.x1x2. Xn ,y=0.y1y2. Yn,
i.e. all positive decimal fraction X· y= X · 0.y1y2. Yn
= X• (2-1y1+2-2y2+...+2-n+1yn-1+2-nyn)
= X• (2-nyn+2-n+1yn-1+...+2-2y2+2-1y1)
= (.. ((0+ Yn X) 2-1+yn-1x) 2-1) + ...) +Y2X) 2-1) +y1x) 2--1)
Based on the above calculation procedure,
The available algorithms are as follows:
A0=0
a1=(a0+ynx) 2-1
A2=(a1+yn-1x) 2-1
...
an-1=(an-2+y2x) 2-1
an =(an-1+y1x) 2-1
Product X· Y=an
For example 1:
X =0.1101, y =-0.1011 for y * y
Calculation process:
For example 2:
X = -0.1011, y =-0.0110 for the original code (Y * y)
The calculation process is as follows:
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
The calculation of one source code multiplication