Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Please show only structural hazards. mov [100], [150] mov [200], [250] add [1

ID: 3570473 • Letter: 1

Question

1. Please show only structural hazards. mov [100], [150] mov [200], [250] add [150], [250], r3 sub r3, #5, r4 add r3, #2, r5 div r4, r5, IS Fi IDi Co IFo Ei W Instruction encoding: instruction opl , op2, result; [xxxx] - memory address; #x - constant; rx - register. 2. Please show only data hazards. mov [100], [150] Fi D3i CO Fo Ei mov [200], [250] add [100], [150], [300] I add [300], #100, [322] add [300], #200, [333] sub [250], [322], [326] 3. Memory is divided in 32 blocks, cache size is 8 blocks. In which cache slot should be put block nr 20 if cache organization is:

Explanation / Answer

1)

mov [100][150]

Fi

Di

Co

Fo

Ei

W

mov [200][250]

Fi

Di

Co

Fo

Ei

W

add [150],[250],r3

Fi

Di

Coadd

Foadd

Ei

Wr3

sub r3,#5, r4

idle

Fi

Di

Cosub

Foadd

Ei

Wr4

add r3,#2,r5

idle

Fi

Di

Coadd

Foadd

Ei

Wr5

div r4,r5,r6

idle

Fi

Di

Codiv

Foiv

Ei

Wr6

2)

mov [100][150]

Fi

Di

Co

Fo

Ei

W[150]

mov [200][250]

Fi

Di

Co

Fo

Ei

W[250]

add [100], [150],[300]

Fi

Di

Coadd

Foadd

Ei

W[300]

add [300],#100, [322]

idle

Fi

Di

Coadd

Foadd

Ei

W[322]

add [300],#200,[333]

idle

Fi

Di

Coadd

Foadd

Ei

W[333]

sub [250,[322][326]

idle

Fi

Di

Codiv

Foiv

Ei

W[326]

3)

The size of total memory is 25=32 blocks and the cache size is 8 blocks 28-1=27 is size of the cache.

If the organization is a two way, then the nr 20 is placed in 20’Th block.

Since, there are 32 blocks in main memory, which tells that in a 32 block of main memory, if 8 blocks of cache are being placed, and then the nr 20 will fit at 20’Th block.

BLOCK 0

0

0

BLOCK 1

1

1

BLOCK 2

2

2

BLOCK 3

3

3

BLOCK 4

4

4

BLOCK 5

5

5

BLOCK 6

6

6

BLOCK 7

7

7

BLOCK 8

8

8

BLOCK 9

9

9

BLOCK 10

10

10

BLOCK 11

11

11

BLOCK 12

12

12

BLOCK 13

13

13

BLOCK 14

14

14

BLOCK 15

15

15

BLOCK 16

16

16

BLOCK 17

17

17

BLOCK 18

18

18

BLOCK 19

19

19

BLOCK 20

20

20

BLOCK 21

21

21

BLOCK 22

22

22

BLOCK 23

23

23

BLOCK 24

24

24

BLOCK 25

25

25

BLOCK 26

26

26

BLOCK 27

27

27

BLOCK 28

28

28

BLOCK 29

29

29

BLOCK 30

30

30

BLOCK 31

31

31

mov [100][150]

Fi

Di

Co

Fo

Ei

W

mov [200][250]

Fi

Di

Co

Fo

Ei

W

add [150],[250],r3

Fi

Di

Coadd

Foadd

Ei

Wr3

sub r3,#5, r4

idle

Fi

Di

Cosub

Foadd

Ei

Wr4

add r3,#2,r5

idle

Fi

Di

Coadd

Foadd

Ei

Wr5

div r4,r5,r6

idle

Fi

Di

Codiv

Foiv

Ei

Wr6