Question

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

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.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

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.

Add a comment
Know the answer?
Add Answer to:
Question 4 (10 pt). One difference between a write-through cache and a write-back cache can be...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • (a)What is the average memory access time (AMAT) if a cache uses write-back strategy and 20%...

    (a)What is the average memory access time (AMAT) if a cache uses write-back strategy and 20% of the data blocks to be swapped out are dirty. Assume that the miss rate is 15%, the hit time of the cache is 1 cycle and the miss penalty is 8 cycles for the data blocks that are not dirty and 20 cycles for those blocks that are dirty. (b) What is the speedup up if we add a “write-buffer” that eliminates 40%...

  • Base machine has a 2.4GHz clock rate. There is L1 and L2 cache. L1 cache is...

    Base machine has a 2.4GHz clock rate. There is L1 and L2 cache. L1 cache is 256K, direct mapped write through. 90% (read) hit rate without penalty, miss penalty is 4 cycles. (cost of reading L2) All writes take 1 cycle. L2 cache is 2MB, 4 way set associative write back. 95% hit rate, 60 cycle miss penalty (cost of reading memory). 30% of all instructions are reads, 10% writes. All instructions take 1 cycle - except reads which take...

  • Assume a cache with a write-through policy, non-write allocate. Your cache has a miss rate of...

    Assume a cache with a write-through policy, non-write allocate. Your cache has a miss rate of 5%. There is a 150 cycle miss penalty. Additionally, it takes an extra 30 cycles to do a write. Your program has a base CPI of 1, is 20% loads, and 5% stores. What will its CPI be?

  • 2. Cache hierarchy You are building a computer system with in-order execution that runs at 1...

    2. Cache hierarchy You are building a computer system with in-order execution that runs at 1 GHz and has a CPI of 1, with no memory accesses. The memory system is a split L1 cache. Both the I-cache and the D-cache are direct mapped and hold 32 KB each, with a block size of 64 bytes. The memory system is split L1 cache. Both the I-cache and the D-cache are direct mapped and hold 32 KB each, with a block...

  • A particular (fictional) CPU has the following internal units and timings: 1. IFD: Instruction fetch + decode : 160 ps...

    A particular (fictional) CPU has the following internal units and timings: 1. IFD: Instruction fetch + decode : 160 ps 2. RR: Register read 80 ps 3. ALU: 240 ps 4. MA : memory access: 160 ps (assuming cache) 5. RW : register write : 80 ps There are 5 basic instruction types: 1. LOAD : IFD+RR+ALU+MA+RW 720 ps 2. STORE: IFD+RR+ALU+MA : 640 ps 3. ARITHMETIC: IFD+RR+ALU+RW : 560 4. BRANCH: IFD+RR+ALU : 480 ps 5. MEMOP: IFD+RR+MA+ALU+MA :...

  • a) Calculate the AMAT for a cache system with one level of cache between the CPU...

    a) Calculate the AMAT for a cache system with one level of cache between the CPU and Main Memory. Assume that the cache has a hit time of 1 cycle and a miss rate of 11%. Assume that the main memory requires 300 cycles to access (this is the hit time) and that all instructions and data can be found in the main memory (there are no misses). b) Let us modify the cache system from part (a) and add...

  • 6. What is the difference between a Direct map cache and Set associative cache. If we...

    6. What is the difference between a Direct map cache and Set associative cache. If we are looking for block #26, block 32 and block #10 in an 8 way set associative and 4 block direct mapped cache. Where can we find these blocks. (Show your work) 7. What are the differences between SRAM, DRAM, SDRAM, who implements SRAM and SDRAM 8. What is a DIMM, So-Dimm and DDR, list different versions of DDR, what are the differences between those...

  • Question 4 (9 pts total) program consists of 8 instructions. Each instruction takes an average of...

    urgent help needed in computer architecture ! Thanx Question 4 (9 pts total) program consists of 8 instructions. Each instruction takes an average of 140 ns to access memory and decode the instruction. It takes an additional 20 ns for the CPU to process each instruction. 4.1 How long does the program take to run? (3 pts) 4.2 An interrupt occurs during the program that delays the program by 240 ns. What percentage of time is spent processing data by...

  • (15pts) Answer each of the following with a TRUE (T) or (1) Data in SRAM will...

    (15pts) Answer each of the following with a TRUE (T) or (1) Data in SRAM will be lost without refreshing frequently or FALSE (F) 9. (2) A cache is a small fast memory that stores a subset of the informatio (3) In set associative cache, ory block can be placed in only (4) The unit of data transfer between cache and main memory is a w (5) When CPU requests a word and cannot find it in cache, it a...

  • Q.. Chocoe the right anwerts .20 points Which one in the right order of datapath thst...

    Q.. Chocoe the right anwerts .20 points Which one in the right order of datapath thst an imstcto shld w along b) MEM-ID-EX-IF WB 2 Hazard is a situation that prevents the next instruction to start in nest cycle. If the hazard occurs dae to a required resource which is busy, which hazard tha a) Data Hazard b) Structure Hazard c) Control Hazard d) All of the above 1.3 "Iems accessed roceistly are likely to be accossed again soon instructions...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT