Chapt er 15: Numer ical St r engt h Reduct ion Keshab K. Parhi - - PowerPoint PPT Presentation

chapt er 15 numer ical st r engt h reduct ion
SMART_READER_LITE
LIVE PREVIEW

Chapt er 15: Numer ical St r engt h Reduct ion Keshab K. Parhi - - PowerPoint PPT Presentation

Chapt er 15: Numer ical St r engt h Reduct ion Keshab K. Parhi Sub-expression eliminat ion is a numerical t ransf ormat ion of t he const ant mult iplicat ions t hat can lead t o ef f icient hardware in t erms of area, power and speed.


slide-1
SLIDE 1

Chapt er 15: Numer ical St r engt h Reduct ion

Keshab K. Parhi

slide-2
SLIDE 2
  • Chap. 15

2

  • Sub-expression eliminat ion is a numerical t ransf ormat ion of

t he const ant mult iplicat ions t hat can lead t o ef f icient hardware in t erms of area, power and speed.

  • Sub-expression can only be perf ormed on const ant

mult iplicat ions t hat operat e on a common variable.

  • I t is essent ially t he process of examining t he shif t and add

implement at ions of t he const ant mult iplicat ions and f inding redundant operat ions.

  • Example: a × x and b × x, where a = 001101 and

b = 011011 can be perf ormed as f ollows: – a × x = 000100 × x + 001001 × x – b × x = 010010 × x + 001001 × x = (001001 × x) < < 1 + (001001 × x). – The t erm 001001 × x needs t o be comput ed only once. – So, mult iplicat ions were implement ed using 3 shif t s and 3 adds as opposed t o 5 shif t s and 5 adds.

slide-3
SLIDE 3
  • Chap. 15

3

Multiple Constant Multiplication(MCM)

The algorit hm f or MCM uses an it erat ive mat ching

process t hat consist s of t he f ollowing st eps:

  • Express each const ant in t he set using a binary

f ormat (such as signed, unsigned, 2’s complement represent at ion).

  • Det ermine t he number of bit -wise mat ches (non-

zero bit s) bet ween all of t he const ant s in t he set .

  • Choose t he best mat ch.
  • Eliminat e t he redundancy f rom t he best mat ch.

Ret urn t he remainders and t he redundancy t o t he set of coef f icient s.

  • Repeat St eps 2-4 unt il no improvement is

achieved.

slide-4
SLIDE 4
  • Chap. 15

4

01011101 93 c 10110110 182 b 11101101 237 a Unsigned Value Const ant Example:

Binary represent at ion of const ant s

01001101

  • Red. of a,c

00010000

  • Rem. of c

10110110 b 10100000

  • Rem. of a

Unsigned Const ant 10100000

  • Red. of Rem a,b

01001101

  • Red. of a,c

00010000

  • Rem. of c

00010110

  • Rem. of b

00000000

  • Rem. of a

Unsigned Const ant

Updat ed set of const ant s 1

st it erat ion

Updat ed set of const ant s 2nd it erat ion

slide-5
SLIDE 5
  • Chap. 15

5

Linear Transf ormations

  • A general f orm of linear t ransf ormat ion is given as:

y =T*x where, T is an m by n mat rix, y is lengt h-m vect or and x is a lengt h-n vect or. I t can also be writ t en as:

m i x t y

n j j ij i

,..., 1 ,

1

= = ∑

=

  • The f ollowing st eps are f ollowed:
  • Minimize t he number of shif t s and adds required

t o comput e t he product s t ijxj by using t he it erat ive mat ching algorit hm.

  • Format ion of unique product s using t he sub-expression

f ound in t he 1

st st ep.

  • Final st ep involves t he sharing of addit ions, which is

common among t he yi’s. This st ep is very similar t o t he MCM problem.

slide-6
SLIDE 6
  • Chap. 15

6

            = 11 7 11 7 15 2 8 5 13 7 11 12 13 2 8 7 T

  • The const ant s in each column mult iply t o a common variable. For

Example x1 is mult iplied t o t he set of const ant s [7, 12, 5, 7].

  • Applying it erat ive mat ching algorit hm t he f ollowing t able is
  • bt ained.

0010 1100 0100 0111 1011 0010 1001 0010 1000 0101 Column 4 Column 3 Column 2 Column 1

Example:

slide-7
SLIDE 7
  • Chap. 15

7

  • Next , t he unique product s are f ormed as shown

below: p1 = 0101*x1, p2 = 0010*x1, p3 = 1100*x1 p4 = 1000*x2, p5 = 1011*x2, p6 = 0010*x3, p7 = 0111*x3 p8 = 1001*x4, p9 = 0100*x4, p10 = 0010*x4

  • Using t hese product s t he yi’s are as f ollows:

y1 = p1 + p2 + p4 + p6 + p8 + p9; y2 = p3 + p5 + p7 + p8 + p9; y3 = p1 + p4 + p6 + p8 + p9 + p10; y4 = p1 + p2 + p5 + p7 + p8 + p10;

slide-8
SLIDE 8
  • Chap. 15

8

  • This st ep involves sharing of addit ions which are

common t o all yi’s. For t his each yi is represent ed as k bit word (1 ≤ k ≤ 10), where each of t he k product s f ormed af t er t he 2nd st ep represent s a part icular bit posit ion. Thus, y1 = 1101010110, y2 = 0010101110, y3 = 1001010111, y4 = 1100101101.

  • Applying it erat ive mat ching algorit hm t o reduce

t he number of addit ions required f or yi’s we get : y1 = p2 + (p1 + p4 + p6 + p8 + p9); y2 = p3 + p9 + (p5 + p7 + p8); y3 = p10 + (p1 + p4 + p6 + p8 + p9); y4 = p1 + p2 + p10 + (p5 + p7 + p8);

  • The t ot al number of addit ions are reduced f rom

35 t o 20.

slide-9
SLIDE 9
  • Chap. 15

9

Polynomial Evaluation

Evaluat ing t he polynomial: x13 + x7 + x4 + x2 + x

  • Wit hout considering t he redundancies t his polynomial

evaluat ion requires 22 mult iplicat ions.

  • Examining t he exponent s and considering t heir binary

represent at ions: 1 = 0001, 2 = 0010, 4 = 0100, 7 = 0111, 13 = 1101.

  • x7 can be considered as x4 × x2 × x1. Applying sub-expression

sharing t o t he exponent s t he polynomial can be evaluat ed as f ollows: x8 ×(x4 × x) + x2 × (x4 × x) + x4 + x2 + x

  • The t erms x2, x4 and x8 each require one mult iplicat ion as

shown below: x2 = x × x, x4 = x2 × x2, x8 = x4 × x4

  • Thus, we require 6 inst ead of 22 mult iplicat ions.
slide-10
SLIDE 10
  • Chap. 15

10

Sub- expression Sharing in Digital Filters

  • Example of common sub-expression eliminat ion

wit hin a single mult iplicat ion : y = 0.101000101*x. This may be implement ed as: y = (x > > 1) – (x > > 3) + (x > > 7) – (x > > 9). Alt ernat ively, t his can be implement ed as, x2 = x – (x > > 2) Y = (x2 > > 1) + (x2 > > 7) which requires one less addit ion.

slide-11
SLIDE 11
  • Chap. 15

11

  • I n order t o realize t he sub-expression eliminat ion

t ransf ormat ion, t he N-t ap FI R f ilt er: y(n) = c0x(n) + c1x(n-1) + … + c0x(n-N+1) must be implement ed using t ransposed direct - f orm st ruct ure also called dat a-broadcast f ilt er st ruct ure as shown below:

slide-12
SLIDE 12
  • Chap. 15

12

  • Represent a f ilt er operat ion by a t able (mat rix)

{xij}, where t he rows are indexed by delay i and t he columns by shif t j , i.e., t he row i is t he coef f icient ci f or t he t erm x(n-i), and t he column 0 in row i is t he msb of ci and column W-1 in row i is t he lsb of ci , where W is t he word lengt h.

  • The row and column indexing st art s at 0.
  • The ent ries are 0 or 1 if 2’s complement

represent at ion is used and {1, 0, 1} if CSD is used.

  • A non-zero ent ry in row i and column j represent s

x(n-i) > > j . I t is t o be added or subt ract ed according t o whet her t he ent ry is +1 or –1.

slide-13
SLIDE 13
  • Chap. 15

13

Example: y(n) = 1.000100000*x(n) + 0.101010010*x(n-1) + 0.000100001*x(n-2)

  • 1

1 1 1

  • 1
  • 1
  • 1

1

This f ilt er has 8 non-zero t erms and t hus requires 7 addit ions. But , t he sub-expressions x1 + x1[-1] > > 1

  • ccurs 4 t imes in shif t ed and delayed f orms by various

amount s as circled. So, t he f ilt er requires 4 adds. x2 = x1 – x1[-1] > > 1 y = x2 – (x2 > > 4) – (x2[-1] > > 3) + (x2[-1] > > 8) An alt ernat ive realizat ion is : x2 = x1 – (x1 > > 4) – (x1[-1] > > 3) + (x1[-1] > > 8) y = x2 – (x2[-1] > > 1).

slide-14
SLIDE 14
  • Chap. 15

14

Example: y(n) = 1.01010000010*x(n) + 0.10001010101*x(n-1) + 0.10010000010*x(n-2) + 1.00000101000*x(n-4) The subst ruct ure mat ching procedure f or t his design is as f ollows:

  • St art wit h t he t able cont aining t he coef f icient s of

t he FI R f ilt er. An ent ry wit h absolut e value of 1 in t his t able denot es add or subt ract of x1. I dent if y t he best sub-expression of size 2.

  • 1

1 1 1 1

  • 1
  • 1
  • 1
  • 1
  • 1
  • 1

1 1 1

  • 1
slide-15
SLIDE 15
  • Chap. 15

15

  • Remove each occurrence of each sub-expression

and replace it by a value of 2 or –2 in place of t he f irst (row maj or) of t he 2 t erms making up t he sub-expression.

  • 1

1

  • 2
  • 2
  • 1
  • 1
  • 2

2 1 2

  • 1
  • Record t he def init ion of t he sub-expression. This

may require a negat ive value of shif t which will be t aken care of lat er. x3 = x1 – x1[-1] > > (-1)

slide-16
SLIDE 16
  • Chap. 15

16

  • Cont inue by f inding more sub-expressions unt il done.
  • 1

1

  • 2
  • 2
  • 3

2 3

  • 1
  • 5. Writ e out t he complet e def init ion of t he f ilt er.

x2 = x1 – x1[-1] > > (-1) x3 = x2 + x1 > > 2 y = -x1 + x3 > > 2 + x2 > > 10 – x3[-1] > > 5 – x2[-1] > > 11

  • x2[-2] >

> 1 + x1[-3] > > 6 – x1[-3] > > 8.

slide-17
SLIDE 17
  • Chap. 15

17

  • I f any sub-expression def init ion involves

negat ive shif t , t hen modif y t he def init ion and subsequent uses of t hat variable t o remove t he negat ive shif t as shown below: x2 = x1 > > 1 – x1[-1] x3 = x2 + x1 > > 3 y = -x1 + x3 > > 1 + x2 > > 9 – x3[-1] > > 4 – x2[-1] > > 10

  • x2[-2] + x1[-3] >

> 6 – x1[-3] > > 8.

slide-18
SLIDE 18
  • Chap. 15

18

3-t ap FI R f ilt er wit h sub-expression sharing f or 3-t ap FI R f ilt er wit h coef f icient s c2 = 0.11010010, c1 = 0.10011010 and c0 = 0.00101011. This requires 7 shif t s and 9 addit ions compared t o 12 shif t s and 11 addit ions.

slide-19
SLIDE 19
  • Chap. 15

19

3-t ap FI R f ilt er wit h sub-expression sharing requiring 8 addit ions as compared t o 9 in t he previous implement at ion.

slide-20
SLIDE 20
  • Chap. 15

20

Using 2 most common sub- expressions in CSD representation

  • x – x >

> 2 and x + x > > 2 are t he 2 most common sub- expressions in CSD represent at ion. An FI R f ilt er using t he t erm sharing, where t he t wo most common sub-expressions in CSD numbers 101 and 101, t oget her wit h isolat ed 1 are shared among all f ilt er coef f icient s.

slide-21
SLIDE 21
  • Chap. 15

21

3-t ap FI R f ilt er wit h coef f icient s c2 = 0.10101010101, c1 = 0.10010100101 and c0 = 0.10101010000. 2 addit ions in t he dot t ed square in (a) are shared in (b). Filt er requires

  • nly 7 addit ions and 7 shif t s as opposed t o 12 adds and

12 shif t s in st andard mult iplierless implement at ion.