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

Question 4 (10 pt). One difference between a write-through cache and a write-bac

ID: 3706832 • Letter: Q

Question

Question 4 (10 pt). One difference between a write-through cache and a write-back cache can be in the time it takes to write. During the first cycle, we detect whether a hit will occur, and during the second (assuming a hit) we actually write the data. Let’s assume that 50% of the blocks are dirty for a write-back cache. For this question, assume that the write buffer for the write through will never stall the CPU (no penalty). Assume a cache read hit takes 1 clock cycle, the cache miss penalty is 50 clock cycles, and a block write from the cache to main memory takes 50 clock cycles. Finally, assume the instruction cache miss rate is 0.5% and the data cache miss rate is 1%.

Assuming that on average 26% and 9% of instructions in the workload are loads and stores, respectively, estimate the performance of a write-through cache with a two-cycle write versus a write-back cache with a two-cycle write.

Explanation / Answer

Performance of cache read operations can be calculated as
CPI = CPI executionTime + StalledCyclesPerInstruction

CPIexecutionTime = 26% * 1 + 9% * 2 + 35% * 1 (Load, store and execution execution cycles)

= 0.26 + 0.18 + 0.65 = 1.09

StalledCyclesPerInstruction = MissRateInstruction * MissPenalty + MissRateData * ( 26% * DataMissPenalty + 9% * DataMissPenalty)

Write-Through ( No Instruction Miss Penalty)
StalledCyclesPerInstruction = 0.005 * 0 + 0.01 * ( 0.26 * 50 + .09 * 50) = 0.175
CPI = 1.09 + 0.175 = 1.265

Write-Back
StalledCyclesPerInstruction = 0.005 * 50 + 0.01 * ( 0.26 * 50 + .09 * 50) = 0.425
CPI = 1.09 + 0.425 = 1.515

Therefore, we can say, Write-Back takes more time than Write-Through.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote