Beruflich Dokumente
Kultur Dokumente
DECEMBER, 1963
INTRODUCTION
NT REFERENCE [1] is given a simple method for
an approximated computation of the logarithm to
the base two of a number given in binary form, and,
n '
using this method, a straightforward computation of an
approximation of the product or the quotient of two
such numbers. Here we give an improvement of the
method of Mitchell [1 ] for the computation of the base
two logarithm, decreasing the range of the error of the
approximation by a factor six at the cost of more hardware and more computation time for the implementation. The same principle can be used for a further decrease of the error, of course at a higher cost. The
method here described has been put to use in a nuclear
reactor period-meter as explained in another publication. (See Eder, Combet, and Van Zonneveld [3].) In
Furet, Jacquemin, and Kaiser [2] it is also indicated
that the method of Mitchell [1 ] is applied for this purpose. The logarithmic method here described might also
be used for the generation of products or quotients of
numbers. But then the error analysis of the logarithm
should be complemented with an error analysis of the
product or quotient (see [1]).
The considerations underlying the design of the computer are given in Section I, the design is described in
Section II, and additional technical information on
speed~
an
speed
and siz
size of th
the coptri.ie
computer iS given innScin1
Section III.
1) the characteristic of LAi(N) is equal to the number of bits between the leftmost 1-bit and the
binary point of N, thus 3 for the numbers 3
15 and 4 for the number 16;
~~~~~~~~~~~~~~through
the
2)
approximated mantisse of LA,(N) is formed
~by the bits following the leftmost 1-bit of N.
For the number N= 10110110, the approximated logarithm is thus LA1(N) =111.011011.
Consider now the situation more abstractly. Suppose
N> 1 is a number given in binary expansion. It is easy
to encode N such that it has the form
N
2k(1 + X)
(1)
L(N)
LA1(N)
21
0 _
1
Fig.
1.
*
2
--5
6
TABLE I
APPROXIMATED COMPUTATION OF THE BASE Two
LOGARITHM OF A BINARY NUMBER
Decimal
In the sequel the logarithm to the base two of a numN
N
LA1(NV)
ber N is denoted by L(N) and an approximation to L(N)8300100100
15 denoted by LA(N), with an index if it isconvenient to
9
3.125
1001
distinguish between different approximations.
10
3.250
1010
The approximation LA1(N) to L(N) described in [1]
11
3.350
1010
I.
863
13
14
15
16
3.625
2.750
3 .875
4.000
1 101
1110
1111
10000
Binary
LA1(N)
11t001
11.010
11.01
1 1.101
11.110
11 .111
100.000
864
where k is a non-negative integer and x is a binary fraction, 0<x <1. The value of k is clearly just the number
of bits between the leftmost 1-bit and the binary point
of N, while x consists of all bits of N except its leftmost
1-bit and, since x < 1, the binary point taking the place
of this 1-bit. Thus, for N=10110.101, one finds k=4
and x=0.0110101 so that N=24(1+0.0110101).
For a number N> 1 written as in (1), one has clearly
L(N) = k + L(1 + x).
(2)
The integer k is called the characteristic and the fraction
L(1 +x), which is smaller than 1, is called the mantisse
of L(N). In Mitchell [1 ] the following approximation is
utilized:
LA1(N) = k + x.
Starting with a number N given in binary expansion,
LA1(N) is obtained by simple shifting and counting
operations resulting in k and x in binary expansion. This
operation is easily realized with a small amount of
binary circuitry. (See Mitchell [1] or Section II-A of
this paper.) The error resulting from this method is
Ri(x) = L(N) - LA1(N) = L(1 + x) - x.
(3)
Clearly Ri(x) is independent of k and depends only on
X. In Fig. 2 the value of Ri(x) is given for O<x<1, as
well as the values of L(+x) and x, that is, of L(N) -k
and LA l(N) - k, respectively.
Note that the error Ri(x) given by (3) is everywhere
non-negative. The maximal error Rimax = 0.086 occurs
for x=0.44; the minimal error is zero and occurs for
X0.
DECEMBER
1
.8
6
/+X)
t4
2
R/
o
R1(X)
.2
.4
.6
-x
Fig. 2. Error curve Ri(x) and the curves L(1 +x) and x.
LO +x)
LAP +x)
.25
.5
.75
51
LA2(1 + x)
x+-x
16
+5X) = X +
+
~~~~~~~~~~~~~~LA2(1
64
=
1
3
LA2(1 + x) = x + - x + 8
128
1
LA2(1 X x) =x + -x
The computation of LA2(N) involves not only counting and shifting operations to find the characteristic k
and the approximated mantisse but also binary decision
for the determination of the type of correction and addition of binary numbers. This complicates the circuitry,
of course, and also the total time for the computation
increases.
865
1965
1R2xlo-3
10
6(
< /DESCRIPTION
OF THE COMPUTER
II.
t
4t
11
-2
.5.6.7.8.9
\
.
.6
-4
-61 - - -- - ------
*9 1
\jl ;// computer.
Rt MIN.
and Rz(x).
Rt(x).
Error curves
curves R2(x)
R2(x) and
4. Error
Fig.Fig.4.
A. Basic Circuit
The basic circuit for the computation of the approximated base two logarithm, as given in Mitchell [1], consists of a shift register R and a counter C. (See Fig. 7.)
is
number
thishas
RegistertoRthecontains
shifted
left untilthethenumber
leftmostN;1-bit
quit the
register.
The resulting error R2(x)=L(1+x) -LA2(1x) is
given in Fig. 4. The maximal positive error R2 po
= 0.008 occurs for x=0.44 and the maximal negative
error R2 neg =-0.006 occurs for x=0.25.
The jumps in the error curve R2(x) of Fig. 4 occur at
the change-over from interval to interval, thus for the
values x=0, 1/4, 1/2, and 3/4. Note that the error
R2(X), as well as the forementioned Ri(x), is a number
(not a percentage) giving the deviation from the correct
value L(N) resulting from the described approximation.
Since with this approximation LA2(N) to L(N) positive as well as negative errors can occur, one should use
the error range 0.008+0.006=0.014 to compare it with
the approximation LA,(N), where only a positive error
occurs and the error range equals 0.086. Thus, the
improvement obtained is about a factor 6 in error range.
Clearly one could improve the approximation further
by taking more than four segments. By taking eight
segments instead of four, the error range will be roughly
halved. The realization would require somewhat more
hardware because the decision to find the type of correction and the corrections itself would be more involved.
Also the total computation time would increase.
Until now only the error due to the principle of the
approximation has been considered. In addition to this,
there is, however, in the realization of the computer a
round-off error due to the use of registers of finite length
in which binary numbers are stored.
In the realization described in Section II, the length
of these registers has been chosen to be 7 bits. Hence, in
the realized computer the value obtained as mantisse
may be smaller, by at most - 2 -7=0.0078, than the
value obtained by the previously mentioned considerations.
A digital computer simulation of the actual computation LAt~(N) comprising the proposed corrections and
the round-off errors for 128 values of x between 0 and 1
5
16 x
< x <4f
5
64
1
8
4
128
x
1
2 -
1
2
3
4
3
if -.<x< 1.
DECEMBER
866
CONTr C
SHIFT
1 r
GENERAL
RESET
START
WRITE
SHIFT
Rl
REG. R
AU.REG.
ONE
IR
BIT
IN R
ZERO
SHIFT
SHIFT
WRITE
CORR.REG.
AUX.REG. &
CORREC'TIONS
AUXILIARY
4X116 '4x'8i |-
<
YES4/1"-I <
JX
~~~~~~~mated
1965
TABLE II
x:
1/4
1/4
0
x
3/4
1
_
____________-_______-_
1/16 x
1/4 x
1/8 x
1/16
1/64
1/128
x
x
__
fN
16x
1
o0- >
2
1 V
VAX<
1
<X<3
3 AX<
~~
1=
- l
O<X<U
867
~~~~64
RE'SFET
Fig. 9. Correction register.
64
R
1. x
Rl
16x
-x
-
x
I
~~~~~~~~~~REFERENCES
X X
r
,,,,,,,
l l l l l l l l
AUX.REG.
Fig. 10. Realization of the correction.
~[2] J. Furet, B. Jacquemin, and J. Kaiser, "Les techniques num6riques dans le controle nucleaire des piles atomiques," Onde Elec-