Write Back with Write Allocate:
1. on hits it writes to cache setting “dirty” bit for the block, main memory is not updated;
2. on misses it updates the block in main memory and brings the block to the cache;
3. Subsequent writes to the same block, if the block originally caused a miss, will hit in the cache next time, setting dirty bit for the block. That will eliminate extra memory accesses and result in very efficient execution compared with Write Through with Write Allocate combination.
Write Back with No Write Allocate:
1.on hits it writes to cache setting “dirty” bit for the block, main memory is not updated;
2. on misses it updates the block in main memory not bringing that block to the cache;
3. Subsequent writes to the same block, if the block originally caused a miss, will generate misses all the way and result in very inefficient execution.
CASE1:WRITE BACK WITH NO WRITE ALLOCATE
S1----MISS
S2----MISS
S3-----MISS (block 200 is brought in )
S4-----HIT
S5-----MISS
CASE2:WRITE BACK WITH WRITE ALLOCATE
S1----MISS(100 block is brought in )
S2----HIT
S3-----MISS (block 200 is brought in )
S4-----HIT
S5-----HIT
so Q.8 Answer is C
so Q.9 Answer is D