1 (boca) bijzondere onderwerpen computer architectuur block a introduction

86
1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

Post on 19-Dec-2015

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

1

(BOCA)Bijzondere Onderwerpen

Computer Architectuur

Block A

Introduction

Page 2: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

2

The aims of the course

• Show the relation between the algorithm and the architecture.

• Derive the architecture from the algorithm.• Explaining and formalizing the design

process.• Explain the distinction between structure and

behavior.• Explain some architectures.

Page 3: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

3

The design process

• Behavior: Expresses the relation between the input and the output value-streams of the system

• Structure: Describes how the system is decomposed into subsystems and how these subsystems are connected

• Geometry: Describes where the different parts are located.

Pure behavioral, structural or geometrical descriptions do not exist in practice.

A design description may express:

Page 4: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

4

Abstraction levels

Behavior Structure Geometry

Application

Algorithm

Basic operator

Boolean logic

Physical level

Block level

Processing element

Basic block

Transistor

Board level

Layout

Cell

Page 5: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

5

The Design Process

Spec 0

Idea

Spec 1

Spec N

verification:

by simulation only

by simulation formal verification

by simulation formal verification

For practical reasons

a specification must

be executable

The implementation i is the specification for the implementation i+1

Page 6: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

6

Descriptions

• Predicate logic

• Algebra (language Z, SDL (VDM) )

• Process algebras CCS, CSP, Lotos

• VHDL, Verilog

• Silage, ......

Page 7: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

7

Specification overloading

Specification overloading means that the specification gives a possibly unwanted implementation suggestion,

i.e. the behavioral specification expresses structure

In practice:

A behavioral specification always contains structure.

Page 8: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

8

same function same behavior, different expressions different structure different designs

Example:

2 baz

+ xb

2z

a

2 abaz

suggests:

andx

+

b

2

zax

suggests:

Page 9: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

9

Architecture

Definition:

Architecture is the way in which hardware and software is structured;

the structure is usually based on grandiose design philosophies.

Architecture deals with fundamental elements that affect the way a system operates and thus its capabilities and its limitations.

The New American Computer Dictionary

Page 10: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

10

Our focus

• Array processors.

• Systolic arrays.

• Wave-front array processors.

• Architectures for embedded algorithms

s.a. digital signal processing algorithms.

Page 11: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

11

Array processor

An array processor is a

structure in which

identical processing

elements are arranged

regularly

PE PE PE PE

PEPE PE PE

PEPE PE PE

PEPE PE PE

PEPE PE PE

1 dimension

2 dimensions

Page 12: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

12

PE

PE

PE

PE

PE

PE

PE

PE

PE

PE

PE

PE

PE

PE

PE

PE

PE

PE

Array processor 3 dimensions

Page 13: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

13

Systolic array

In a systolic array

processor all

communication path

contain at least one

unit delay (register).

is register or delay

Delay constraints are local. Therefore unlimited extension without changing the cells

PEPE PE PE

PEPE PE PE

PEPE PE PE

PEPE PE PE

PEPE PE PE

Page 14: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

14

Wave-front array

PEPE PE PE

PEPE PE PE

PEPE PE PE

PEPE PE PE

Page 15: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

15

Array Processors

Can be approached from:

• Application • Algorithm• Architecture•Technology

We will focus on

Algorithm Architecture

Derive the architecture from the algorithm

Page 16: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

16

General purpose processors do not provide sufficient processing power

Array processors: Application areas

• Speech processing • Image processing (video, medical ,.....)• Radar• Weather• Medical signal processing• Geology• . . . . . . . . . . .

Many simple calculations on a lot of datain a short time

Page 17: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

17

Example video processing

1000 operations per pixel (is not that much) 1024 x 1024 pixels per frame (high density TV) 50 frames per second (100 Hz TV)

50 G operations per second < 1 Watt available

Pentium 2Ghz: 2G operations per second> 30 Watt

required 25 Pentiums 750 Watt

Page 18: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

18

Description of the algorithms

In practice the algorithms are described (specified) in:

• some programming language.

In our (toy) examples we use:• programming languages • algebraic descriptions

Page 19: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

19

Examples of algorithms we will use:

Filter:

1

0 ,

N

j jjii xcy

xCy

1

0.

N

i itit xhy

Matrix algebra:

Transformations like Fourier transformZ transform

Sorting

. . . .

Page 20: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

20

Graphs

Graphs are applicable for describing• behavior• structure

Dependency graphsconsist of:

• nodes expressing operations or functions • edges expressing data dependencies or the flow of data

So, graphs are suitable to describe the design flow from

Algorithm to architecture

Page 21: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

21

Design flow example: Sorting

idea

program (imperative)

single assignment code (functional)

dependency graph

recurrent relations

Page 22: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

22

Sorting: the idea

12 10 9

8

8 5 3 2 1

>

12 10 9

8

8 5 3 2 1

>

shiftedone position

empty placeneeded

Page 23: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

23

9 9

8

6 3 3 1

9 9 8 6 3 3 1

8

9 9 8 6 3 3 1

8

8

9 9 8 6 3 3 1

8

y := mj

mj-1 mj mj+1

x

y

x

x

x

y

y

y

mj:= x

x := y

?mx j

mj-1 mj mj+1

mj-1 mj mj+1

mj-1 mj mj+1

Page 24: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

24

if (x>= m[j])

{ y = m[j];

m[j] = x;

x = y;

}

if (x>= m[j]) swap(m[j],x);

m[j],x = MaxMin(m[j],x);

Identical descriptions of swapping

Inserting an element into a sorted array of i elements such that the order is preserved:

m[i] = -infinite

for(j = 0; j < i+1; j++)

{ m[j],x = MaxMin(m[j],x);

}

Sorting: inserting one element

Page 25: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

25

Sorting N elements in an array is composed from N times inserting an element into a sorted array of N elements such that the order is preserved. An empty array is ordered.

for(int i = 0; i < N; i++)

{ for(j = 0; j < i+1; j++)

{ m[j],x[i] = MaxMin(m[j],x[i]);}

}

Sorting: The program

int in[0:N-1], x[0:N-1], m[0:N-1];

for(int i = 0; i < N; i++)

{ x[i] = in[i]; m[i] = - infinite; }

for(int j = 0; j < N; j++)

{ out[j] = m[j];}

input

body

output

Page 26: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

26

Single assignment:

Each scalar variable is assigned only once

Why?

Goal is a data dependency graph

- nodes expressing operations or functions

- edges expressing data dependencies or

the flow of data

Sorting: Towards ‘Single assignment’

Page 27: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

27

Single assignment:

Each scalar variable is assigned only once

Why?

Code Nodes Graph

x=a+b;

x=c*d;

Sorting: Towards ‘Single assignment’

+

*

a

bc

d

x

x

How do you connect these?

Page 28: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

28

Single assignment:

Each scalar variable is assigned only once

Why?

Code

x=a+b;

x=c*d;

Sorting: Towards ‘Single assignment’

Description already optimized towards

implementation: memory optimization.

But, fundamentally you produce two

different values, e.g. x1 an x2

Page 29: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

29

for(int i = 0; i < N; i++)

{ for(j = 0; j < i+1; i++)

{ m[j],x[i] = MaxMin(m[j],x[i]);}

}

Single assignment:

Each scalar variable is assigned only once

Sorting: Towards ‘Single assignment’

Start with m[j]:

m[j] at loop index i depends on the value at loop index i-1

for(int i = 0; i < N; i++)

{ for(j = 0; j < i+1; j++)

{ m[i,j],x[i] = MaxMin(m[i-1,j],x[i]);}

}

hence,

Page 30: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

30

Sorting: Towards ‘Single assignment’

x[i] at loop index j depends on the value at loop index j-1

for(int i = 0; i < N; i++)

{ for(j = 0; j < i+1; i++)

{ m[i,j],x[i] = MaxMin(m[i-1,j],x[i]);}

}

hence, for(int i = 0; i < N; i++)

{ for(j = 0; j < i+1; i++)

{ m[i,j],x[i,j] = MaxMin(m[i-1,j],x[i,j-1]);}

}

Page 31: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

31

All scalar variables are assigned only once.

The algorithm satisfies the single assignment property

for(int i = 0; i < N; i++)

{ for(j = 0; j < i+1; j++)

{ m[i,j],x[i,j] = MaxMin(m[i-1,j],x[i,j-1]);}

}

Sorting: The algorithm in ‘single assignment’

int in[0:N-1], x[0:N-1,-1:N-1], m[-1:N-1,0:N-1];

for(int i = 0; i < N; i++)

{ x[i,-1] = in[i]; m[i-1,i] = - infinite; }

for(int j = 0; j < N; j++)

{ out[j] = m[N-1,j];}

input

body

output

Page 32: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

32

Sorting: The algorithm in ‘single assignment’

-∞

-∞

-∞

-∞

-1

n-1

0 n-1

x0

x1

x2

x3

x0

x1

x2

x3

-1 n-1

n-1

0

in x

m

out

MaxMin

int in[0:N-1], x[0:N-1,-1:N-1], m[-1:N-1,0:N-1];

for(int i = 0; i < N; i++)

{ x[i,-1] = in[i]; m[i-1,i] = - infinite; }

for(int i = 0; i < N; i++)

{ for(j = 0; j < i+1; j++)

{ m[i,j],x[i,j] = MaxMin(m[i-1,j],x[i,j-1]);}

}

i = 1

j = 0

Page 33: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

33

Sorting: The algorithm in ‘single assignment’

-∞

-∞

-∞

-∞

-1

n-1

0 n-1

5

7

4

6

5

7

4

6

-1 n-1

n-1

0

mMM

for(int i = 0; i < N; i++)

{ for(j = 0; j < i+1; j++)

{ m[i,j],x[i,j] = MaxMin(m[i-1,j],x[i,j-1]);}

}

i

j

Page 34: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

34

Sorting: The algorithm in ‘single assignment’

-∞

5 -∞

-∞

-∞

-1

n-1

0 n-1

5 -∞

7

4

6

5

7

4

6

-1 n-1

n-1

0

mMM

for(int i = 0; i < N; i++)

{ for(j = 0; j < i+1; j++)

{ m[i,j],x[i,j] = MaxMin(m[i-1,j],x[i,j-1]);}

}

i

j

Page 35: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

35

Sorting: The algorithm in ‘single assignment’

-∞

5 -∞

7 -∞

-∞

-1

n-1

0 n-1

5 -∞

7 5

4

6

5

7

4

6

-1 n-1

n-1

0

m

for(int i = 0; i < N; i++)

{ for(j = 0; j < i+1; j++)

{ m[i,j],x[i,j] = MaxMin(m[i-1,j],x[i,j-1]);}

}

i

j

Page 36: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

36

Sorting: The algorithm in ‘single assignment’

-∞

5 -∞

7 -∞

-∞

-1

n-1

0 n-1

5 -∞

7 5

4

6

5

7

4

6

-1 n-1

n-1

0

mMM

for(int i = 0; i < N; i++)

{ for(j = 0; j < i+1; j++)

{ m[i,j],x[i,j] = MaxMin(m[i-1,j],x[i,j-1]);}

}

i

j

Page 37: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

37

Sorting: The algorithm in ‘single assignment’

-∞

5 -∞

7 5 -∞

-∞

-1

n-1

0 n-1

5 -∞

7 5 -∞

4

6

5

7

4

6

-1 n-1

n-1

0

m

for(int i = 0; i < N; i++)

{ for(j = 0; j < i+1; j++)

{ m[i,j],x[i,j] = MaxMin(m[i-1,j],x[i,j-1]);}

}

i

j

Page 38: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

38Notice that the order of these relations is arbitrary

m[i,j],x[i,j] = MaxMin(m[i-1,j],x[i,j-1])

Sorting: Recurrent relation

x[i,-1] = in[i]

m[i-1,i] = - infinite

out[j] = m[N-1,j]

input

output

A description in single assignment can be directly translated into a recurrent relation

in[0:N-1], out[0:N-1], x[0:N-1, -1:N-1], m[-1:N-1, 0:N-1];

0 <= i < N;

0 <= j < i+1 }

declaration

body

area

Page 39: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

39

m[i,j],x[i,j] = MaxMin(m[i-1,j],x[i,j-1])

Sorting: Body in two dimensions

The body is executed for all i and j. Hence two dimensions

body

MaxMin

m[i-1,j]

x[i,j-1]

m[i,j]

x[i,j]

j

i

Page 40: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

40

m[i,j],x[i,j] = MaxMin(m[i-1,j],x[i,j-i])

Sorting: Body implementation

body

if( m[i-1,j] <= x[i,j-1]) { m[i,j] = x[i,j-1]; x[i,j] = m[i-1,j]; }else { m[i,j] = m[i-1,j]; x[i,j] = x[i,j-1]); }

m[i-1,j]

x[i,j-1]

m[i,j]

x[i,j]

j

i

1

0

0

1

Page 41: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

41

Sorting: Implementation N = 4

j

i

PEPE

PEPE PE

PEPE PE PE

PE

PE = MaxMin

m[3,0]

x[0,-1]

x[1,-1]

x[2,-1]

x[3,-1]

-1

m[3,1] m[3,2] m[3,3]

m[-1,0]=

m[0,1]=

m[1,2]=

m[2,3]=

3

2

1

0

-1 3210

Page 42: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

42

Sorting: Example N = 4

5

3

1

5

2

3 2 1

Page 43: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

43

Something on functions

Tuple : BbAaba ,

Cartesian product: set of all tuples

The number of tuples in the set

BAba ,

BAba is,

BABA

If Q is a set and P is a subset of Q,

then the set of all subsets of Q is

The number of subsets of Q is

Hence, the set of all subsets of

and the number of subsets of

QP Q2

QQ 22 BABA 2is

BABABA 22is

Page 44: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

44

Something on functions

Function F YXF

YX is the set of all functions with domain X and co-domain Y

F is a function in if and only if YX

Each element of the domain of X is mapped by F on a single element of the codomain Y

Hence YaFXaa :

and cbcaFbaFXacba :,,

F can be represented as a set of tuples

Hence,

YbXaba andwith,

YXYX 2

Page 45: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

45

Functions, Arrays, Tuples, Sequences, ....

Arrays, tuples and sequences are all representations of the same set of functions

VD ul ,

in which Dl,u is a closed subset of the set of integers Z

uzlZzzD ul |,

and V is some value co-domain

corresponds to

,,.....,,, 1210 NyyyyySo

VDy N 1,0

Hence, yi, y(i) and y[i] are syntactically different notations for the function value in i.

Page 46: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

46

Functions on more than one variableCurrying

A function on two variables can be represented in three different ways:

abFbaFbaF ,

baFvvba F ,,

VBAF

VvBAbavbaF ,|,,

:,baF

Page 47: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

47

Functions on more than one variableCurrying

abFbaFbaF ,

VBAF *

VBpAapaF |,

:baF baFvvba aFF

VABF **

VAqBbqbF |,

:abF abFvvab bFF

Page 48: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

48

Functions on more than one variableCurrying (Example)

3,2,1,02,1,02 babav

86422

75311

64200

3210

a

bv

73

52

31

10

1F

62

51

40

2F

12212,1 FFF

Page 49: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

49

Linear Time Invariant Systems

Fx y

x and y are streams.

ztime

ztime

VZx VZy

VZVZF

Time is represented by the set of integers Z, so F maps functions on functions

Obviously, this class of functions also models systems that cannot exist in reality. For example non-causal systems

Page 50: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

50

Adding functions

x and y are streams modeled by functions on Z.

z

time

VZxi

+

=

Zzallforzxzxzxxxx 213213

Page 51: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

51

Linear functions, linear systems

Definition:

A system F is called linear if 2121 .... xFbxFaxbxaF

2121

22

11 ...

.xbxaFyy

xFby

xFay

or

x1

x1+x2

x2

y1

y1+y2

y2

Page 52: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

52

Time invariant systems

Definition:

A system F is called time invariant if

tyty

xFy

txtx

xFy

12

22

12

11

)(

x1

x2

y1

y2

Page 53: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

53

Linear time-invariant systems

Why?

Linear: Because they can easily be described

Time-invariant: Because electrical systems like transistors resistors capacitance and induction satisfy this property.

Page 54: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

54

The convolution algorithm

The behavior of a linear time-invariant system can be fully described by its impulse response h, i.e. the response on the output to a single unit pulse on the input.

The response y on the output to an input stream x then follows from:

i

izhixzy .

hxy or

We will derive this convolution operation for time discrete signals

Page 55: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

55

The convolution algorithm

Let the unit sample sequence be defined by

otherwise0

if1 zizi In which

z represents time,

i represents the location of the unit pulse

Zzi ,

VZi

VZZ

zi

z

1

i

Page 56: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

56

The convolution algorithm

• Step 1: express x using a delta function

Page 57: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

57

The convolution algorithm

Then

2.2 x

i

iixx .

3.3 x

4.4 x

5.5 x

zx1 2 3 4 5 6 7

in which (i) is a function on Z and x(i) is a scalar

Page 58: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

58

The convolution algorithm

• Step 1: express x using a delta function• Step 2: rewrite time-shifted delta function

Page 59: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

59

The convolution algorithm

Shifting over

z0

zx

10-1 2 3 10-1 2 3

zy

zz Hence zxzy

z2

izzi 0Hence zz

Page 60: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

60

The convolution algorithm

• Step 1: express x using a delta function• Step 2: rewrite time-shifted delta function• Step 3: rewrite impulse response using time

invariance property

Page 61: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

61

The convolution algorithm

Consider a linear time-invariant system F

z

Let h*(i) be the response of this system to the unit sample sequence (i).

F(i) h*(i)

z

F is time-invariant, so

izhzih 0**

(i)(z) h*(i)(z)

Page 62: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

62

The convolution algorithm

• Step 1: express x using a delta function• Step 2: rewrite time-shifted delta function• Step 3: rewrite impulse response using time

invariance property• Step 4: rewrite impulse response using linearity

property

Page 63: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

63

The convolution algorithm

Example

z

F(i) h*(i)

(0)(z) h*(0)(z)

10-1 2 3 10-1 2 3

z

-(1)(z) -h*(1)(z)

10-1 2 3 10-1 2 3

½.(2)(z) ½. h*(2)(z)

10-1 2 3 10-1 2 3

izazia 0.. izhaziha 0*.*.

4

Page 64: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

64

The convolution algorithm

• Step 1: express x using a delta function• Step 2: rewrite time-shifted delta function• Step 3: rewrite impulse response using time

invariance property• Step 4: rewrite impulse response using linearity

property• Step 5: rewrite general expression by means of

algebraic manipulation using result from step 4.

Page 65: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

65

The convolution algorithm

in which h is called the impulse response of the system F

Fx y

xFy

iFih *

hh 0*

Page 66: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

66

The convolution algorithm

F is linear and x(i) is a scalar, hence

From the preceding we derive:

i

iixx .

i

iixFy .

i

iFixy .

i

ihixy *.

scalar

function on Z

iFih *

Page 67: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

67

The convolution algorithm

continue

i

ihixy *.

recall

zihixzyi

*.

Zzallforzhzhzhhhh 213213

zihixzyi

*.

izhzih 0**

izhixzyi

0*.

recall

Page 68: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

68

The convolution algorithm

continue izhixzyi

0*.

izhixzyi

.

This is called the convolution operation, denoted by

hxy

hh 0*recall

We will apply this formula several times

Page 69: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

69

The convolution algorithm

izhixzyi

.

and if the impulse response h is finite (bounded), i.e.

continue

jhjzxzyj

.

with j = z – i, we obtain:

Nzor0if0 zzh

we get jhjzxzy

N

j

1

0

.

Page 70: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

70

Dependency Graphs and Signal Flow Graphs

The array processor described: • the way in which the processors are

arranged and• the way in which the data is communicated

between the processing elements.

PEPE PE PE

PEPE PE PE

PEPE PE PE

So we may consider it as a Dependency Graph or

a Signal Flow Graph

Hence, the graph describes the dependencies of the data that is communicated, or said differently:

The graph describes the way in which the data values at the outputs of a processing element depend on the data at the outputs of the other processing elements.

Page 71: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

71

Dependency graphs and Signal Flow Graphs

Dependency Graph:All communicated values are scalars and the processing elements are functions on scalars. Each arrow carries only one value. Time does not play a role.

PEPE PE PE

PEPE PE PE

PEPE PE PE

Signal Flow Graph:The communicated values are streams, i.e. functions on time and the processing elements are functions on steams.

NN VVPE

NN VZVZPE

V is the value domain, number of inputs = number of outputs = N

Z represents time

Page 72: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

72

Recurrent relations

For simple algorithms the transformation from single assignment code to a recurrent relation is simple.

Questions to answer:

• How do recurrent relations influence the dependency graph

• How can recurrent relations be manipulated such that the behavior remains the same and the structure of the dependency graph is changed

We will answer these questions by means of an example: Matrix-Vector multiplication bAc

.

Page 73: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

73

Matrix Vector multiplication

Recurrent relations:

bAc

. j

N

j jii bac

1

0 , .

jjijiji bass .,1,,

01, is 1, Nii sc

1,,0 Ki

Alternative (because is associative)

jjijiji bass .,1,,

0, Nis 0,ii sc

1,,0 Nj

1,,0 Ki 1,,0 Nj

Page 74: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

74

Matrix Vector multiplication

The basic cell is described by: jjijiji bass .,1,,

We have two indices i and j, so the dependency graph can be described as a two-dimensional array

PEsi,j-1 si,j

bj

i

j

+si,j-1

bj

x

ai,j

si,j

Page 75: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

75

DG-1 of the Matrix Vector multiplication

b0, b1 and b2 are global dependencies.

Therefore this graph is called a

Globally recursive Graph

j

i

s0,2=c0

b0

PEPE PE

PEPE PE

PEPE PE

PEPE PE0

0

0

0

s1,2=c1

s2,2=c2

s3,2=c3

b1 b2

S0,0 s0,1

s1,0

s2,0

s3,0

s0,-1

s3,-1

01, is

2,ii sc

3,2,1,0i

2,1,0j

jjijiji bass .,1,,

(K = 4)

(N = 3)

Page 76: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

76

DG-2 of the Matrix Vector multiplication

j

i

b0

PEPE PE

PEPE PE

PEPE PE

PEPE PE 0

0

0

0

b1 b2

s0,1 s0,2

s1,1

s2,1

s3,1

s0,3

s3,3

3,2,1,0i

2,1,0j

c0=s0,0

c1=s1,0

c2=s2,0

c3=s3,0

0, Nis

0,ii sc

jjijiji bass .,1,,

(K = 4)

(N = 3)

Page 77: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

77

Variable naming and index assignment

A variable associated to an arrow gets the indices of the processing element that delivers its value.

j

i PEi,j

ai,j-1

bi-1,j-1

bi,j

ai,j

ci,j

ci-1,j

( i , j )

Local constants get the indices of the processing element that they are in

PEi,j

vi,j

Page 78: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

78

Recurrent relations: Conclusion

The associative operations and result in two different recurrent relations and thus in two different dependency graphs.

11

Ni ixyEquation results in

111 ,0, Niii sysxss

01 0 sy,s,xss Niii

1

0Ni ixyEquation results in

1,,1,0with Ni

1,,1,0with Ni

111 ,1,. Niii sysxss

01 ,1,. sysxss Niii

Other associative operations are for example ‘AND’ and ‘OR’.

Page 79: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

79

Changing global data dependencies into local data dependencies

Global data dependencies resist manipulating the dependency graph

jijijiji dass ,1,1,, .

01, is 1, Nii sc

Local data dependencies

j

N

j jii bac

1

0 , .

Global data dependencies

01, is 1, Nii sc

jjijiji bass .,1,,

jj bd .1 jiji dd ,1,

ci

ci

bj

bj

di-1,j

si,j

j

i

Page 80: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

80

Changing global data dependencies into local data dependencies

So the matrix-vector multiplications becomes:

jijijiji dass ,1,1,, .

j

N

j jii bac

1

0 , .

01, is

1, Nii sc

jj bd .1

jiji dd ,1,

s0,2=c0

b0=d-1,0

PEPE PE

PEPE PE

PEPE PE

PEPE PE0

0

0

0

s1,2=c1

s2,2=c2

s3,2=c3

b1=d-1,1 b2=d-1,2

s0,0 s0,1

s1,0

s2,0

s3,0

s0,-1

s3,-1

d0,0

d1,0

d0,1

Relations:

Locally recursive graph

3,2,1,0i 2,1,0j

(K = 4)

(N = 3)

Page 81: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

81

Alternative transformation from global data dependencies to local data dependencies

jijijiji dass ,1,1,, .

01, is 1, Nii sc

Local data dependencies

j

N

j jii bac

1

0 , .

Global data dependencies

01, is 1, Nii sc

jjijiji bass .,1,,

jjN bd , jiji dd ,1,

ci

bi

bi

ci

di,j

si,j

Page 82: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

82

Changing global data dependencies into local data dependencies

So the alternative locally recursive graph becomes:

j1,iji,1ji,ji, .dass

j

N

j jii bac

1

0 , .

01, is

1, Nii sc

jjK, bd

jiji dd ,1,

s0,2=c0

b0=d4,0

PEPE PE

PEPE PE

PEPE PE

PEPE PE0

0

0

0

s1,2=c1

s2,2=c2

s3,2=c3

b1=d4,1 b2=d4,2

s0,0 s0,1

s1,0

s2,0

s3,0

s0,-1

s3,-1

d1,0

d2,0

d1,1Relations:

3,2,1,0i 2,1,0j

(K = 4)

(N = 3)

Page 83: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

83

Shift-invariant graph

Consider an N-dimensional dependency graph with processing elements PE at locations (i,j,k, ...) .

Base (1,0,0,..), (0,1,0,..), (0,0,1,...), ... .

If for any (i,j,k, ...) and for any input x of the PE at (i,j,k, ...) that is delivered by the output x of PE at (p,q,r,... ), holds that the input x of the PE at (i,j+1,k,...) is delivered by the output x of the PE at (p,q+1,r,... ), then the graph is called shift-invariant in the direction (0,1,0,..).

j

iSh-Inv in direction i and jSh-Inv in direction i

Page 84: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

84

Shift-invariant graphs (Examples)j

i

Sh-Inv in direction i and j

Sh-Inv in no direction

Sh-Inv in no direction

Sh-Inv in direction j

Page 85: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

85

Shift-invariant graphs

Because the inputs and outputs often negatively influence the shift-invariance property, the inputs and outputs are treated separately.

Hence, we always distinguish between

• Input edges,

• Output edges and

• Intermediate edges

Page 86: 1 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

86

Dependeny Graphs

Conclusions:

Associative operations give two alternative DG’s.

Input, output and intermediate edges will be treated separately.

Transformation from global to local dependencies gives two alternative DG’s.