921 views
2 votes
2 votes
When we are asked to find access time for a cache having write through or write back policy.....which cache access method to apply(hierarchial or simultaneous).

nd also

Consider the following instructions.

I1 : R1 = 100

I2 : R1 = R2 + R4

I3 : R2 = R4 + 25

I4 : R4 = R1 + R3

I5 : R1 = R1 + 30

Calculate sum of (WAR, RAW and WAW) dependencies the above instructions. (a) 10 (b) 12 (c) 6 (d) 8

2 Answers

1 votes
1 votes

Q. When we are asked to find access time for a cache having write through or write back policy.....which cache access method to apply(hierarchial or simultaneous) ?

Ans: In all such question, you will be given directly or indirectly which method to use either hierarchical or simultaneous.

For example : take this question for reference https://gateoverflow.in/11137/coa., in this they have clearly mentioned what to do once miss occur at cache, then it will access from main memory and load it into cache then refer it, so this is an example of hierarchical access.

Same way if it is simultaneous it will directly access it from the memory level it has found the word.it will not load it into the first level and then access it.


I1 : R1 = 100
I2 : R1 = R2 + R4
I3 : R2 = R4 + 25
I4 : R4 = R1 + R3
I5 : R1 = R1 + 30

RAW ( true data dependency ) 4
I1 -> I5
I1 -> I4
I2 -> I5
I2 -> I4

WAR ( Write After Read ) 4
I2 -> I3
I2 -> I4
I3 -> I4
I4 -> I5

WAW ( Write After Write ) 3
I1 -> I2
I1 -> I5
I2 -> I5

Total = 4 + 4 + 3 = 11

0 votes
0 votes

RAW Dependency - 2

I-4 on I-2

I-5 on I-2

WAR Dependency - 4

I-3 on I-2

I-4 on I-2

I-4 on I-3

I-5 on I-4

WAW Dependency - 2

I-2 on I-1

I-5 on I-2

Total dependency = 8

Option- d is answer

note- consider the case of two consecutive writes like here in I-1 and I-2 by doing multiple questions to calculate dependency.

Related questions

1 votes
1 votes
0 answers
1
atul_21 asked Jan 1, 2018
285 views
In Block Replacement techniques, which one leads to poor performance when accesses are made to sequential elements of an Array that is slightly too large to fit into the ...
0 votes
0 votes
0 answers
2
elakashi sharma asked Apr 27, 2017
300 views
How we replace blocks in k-way set associative cache ? What strategy we follow?
3 votes
3 votes
1 answer
3
gate_forum asked Nov 6, 2015
431 views
can cache block replacement and page replacement activities clash with each other?