AN\soutD
p2 = 00000000
XNOR
(P = 6/8, N = 1/2)
p2 = 01001000 (1/4)
(P = 0, N = -1 )
-
(b)
Figure 3.1: Two types of multiplier: (a) Unsigned multiplier and (b)
Signed multiplier [6]
The first one to mention is the multiplier. An unsigned
multiplier is simply an AND gate with 2 input and 1 output as shown in
Fig.3.1a. Considering two bit
sequences not being correlated, with two streams p1 and p1
which represent two probability 1/2 and 1/4, respectively,
the exact result 1/8 at output can be achieved with stream
p3. It can be mathematically illustrated as below:
pout = P (Output = 1)
= P (Input1 = 1 and Input2 = 1)
= P (Input1 = 1) .P (Input2 = 1)
= p1.p2
(3.1)
where Input1 and Input2 are independent. However, SNs
inherently belong to Bernoulli process which causes a variance to the
output [9], given by
var (pˆout) = p1var (pˆ2) + p2var
(pˆ1) − N var (pˆ1) var (pˆ2) (3.2)
where var(pˆi) = σ2 (pˆi) , i
= 1, 2, σ (pˆi) calculated as
(1.6). Consequently, the accuracy of
output will be reduced.
It is similarly to implement a signed multiplier
[6] as illustrated in Figure
3.1b. In this case, an XNOR gate was
used. To understand its operation, it is necessary to comprehend the
transforming between
unipolar and bipolar forms of SN which will was detailed in the first
chapter. Here p1 and p2 express two signed number in
probability form −1/2 and −1, respectively, and the
obtained result is perfectly
1/2 at the output p3. Once again, the independence between
two sequences is assumed to get exactly the outcome.
Stochastic
Scaled
Addition/Subtraction
\label{stochastic-scaled-additionsubtraction}
The next element is the scaled adder which performs the scaled
addition to assure the result being in the interval [0, 1].
Assuming the inputs being independent,
Fig.3.2a shows how to implement such
operator in SC, which describes the formula as follows:
pout = s.p1 + (1 − s) .p2 (3.3)
where s designates the selection signal of the MUX. For instance,
with two inputs p1 = 3/4 and
p2 = 1/4, the received output is (1/2)(3/4)
+ (1 − 1/2)(1/4) = 1/2 = 4/8.
However, the practical result of this operation is equally affected by
the variance at the output [9],
given by
var (pˆout) = svar (pˆ1) + (1 − s)
var (pˆ2) + (p1 − p2) var (s) (3.4)