Distributed Arithmetic - Part 1 K. Sridharan

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

Distributed Arithmetic

- Part 1

K. Sridharan
What is Distributed Arithmetic (DA) ?

 An efficient technique for calculation of inner


product
 Inner product is a key component of the MAC
operation common in Digital Signal Processing
Algorithms
Is there a direct method of implementing
inner products ?
 Yes, a direct method is via dedicated multipliers
 Multipliers are fast but they consume considerable
hardware.
 Moreover, one can take advantage of memory on a
chip and compute the dot product without using
dedicated multipliers
How does distributed arithmetic work?
 Distributed Arithmetic (DA) is a technique that is bit-
serial in nature.
 DA `replaces’ the explicit multiplications by ROM
look-ups  an efficient technique to implement on
Field Programmable Gate Arrays (FPGAs)
Example to motivate distributed arithmetic
Can rewrite the dot product as
Table for distributed arithmetix
Using the table, we have
What about the second bit?
Now moving to the third bit ..
Considering the third bit from the right end and all
the three strings, we have
110
For this, the table entry is A2 + A3

We have moved by two positions from the right end,


therefore we need to multiply by 22
Overall, we have
(A1 + A2 )20 + (A1 + A2 )21 + (A3 + A2 )22

= (27 + 6)20 + (27 + 6)21 + (5 + 6)22


--- this is distributed arithmetic

Exercise: Verify that this gives the same result as the


“lumped” calculation, namely
(5 x 4) + (6 x 7) + (27 x 3)
What have we achieved ?
 Dot product without explicit multiplication (or
multiplication hardware)
 Instead, dot product using a ROM and shifters (will
show the architecture soon)
Additional remarks on the example
 We label the last column entries in the table as ROM
contents since only these are stored in the ROM
 That is, we note that 5, 6 and 27 are constant and
are prestored in ROM
 In filter applications, coefficients are typically fixed
and hence can be put in the ROM
 b2, b1 and b0 come on address lines
 We have assumed unsigned numbers in the
example but can extend to signed numbers
The DA formulation (from S. White paper in reference)
K

 Consider y   Ak xk …(1)
k 1
 a. Let xk be an N-bit scaled two’s complement number. In
other words,
| xk | < 1
xk : {bk0, bk1, bk2……, bk(N-1) }

where bk0 is the sign bit N 1


 b. We can express xk as x k   bk0   kn
b 2 n

n 1
…(2)
 c. Substituting (2) in (1),
K
 N 1

y   Ak  bk 0   bkn 2 n 
k 1  n 1 
K K N 1
y   bk 0  Ak     Ak  bkn 2  n …(3)
k 1 k 1 n 1
Can proceed to show that

K N 1

K
 n
y   Ak  (bk 0 )    Ak  bkn  2
k 1 n 1  k 1 
Reference
 S. A. White, Applications of distributed arithmetic to
digital signal processing: A tutorial review,” IEEE
ASSP Magazine, July, 1989 (available from Moodle)

You might also like