Question: Caches are classified as either write - through or write - back. In a writethrough cache, the data written to a cache block is simultaneously

Caches are classified as either write-through or write-back. In a writethrough cache, the data written to a cache block is simultaneously written to main memory. In a write-back cache, a dirty bit (D) is associated with each cache block. D is 1 when the cache block has been written and 0 otherwise. Dirty cache blocks are written back to main memory only when they are evicted from the cache. A write-through cache requires no dirty bit but usually requires more main memory writes than a write-back cache. Modern caches are usually write-back because main memory access time is so large. Suppose a cache has a block size of four words. How many main memory accesses are required by the following code when using each write policy: write through or write-back?
addi t5, zero, 0
sw t1,0(t5)
sw t2,12(t5)
sw t3,8(t5)
sw t4,4(t5)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!