Docsity

Cache Problems for Assignment - Computer Architecture | CSC 520, Assignments of Computer Architecture and Organization

Toggle sidebar
bg1
Computer Architecture
CSC 520
Cache Problems
1.Assume you have 128 blocks of cache memory, into which block or blocks of cache could main
memory block 151 possibly be placed (assume cache and memory blocks are numbered from
zero) if cache is:
a. direct mapped
b. fully associative
c. 4-way set associative
d. 8-way set associative
e. Can you explain the three cache miss types?
2.Assume the instruction execution cycle on your machine could be divided into the following
functions which require the amount of time indicated : IF….12ns, ID…..5ns, EX…..12 ns,
Mem 15 ns, WB 4 ns. Assume pipeline overhead is 1ns.
What would be the cycle time on the unpipelined machine?
What would be the cycle time on the pipelined machine?
What would be the (ideal) speedup due to pipelining?
3.What is Amdahl’s Law?
4. Given a computer that requires 200 seconds to execute a particular program, the machine
spends 70% of its time on floating point operations, 20 % on integer operations, and 10 % on
string manipulation. If you improve one of the operations by a factor of 5, which would you
chose and what will be the performance of the improved machine relative to the original
machine?
5. Assume that a cache hit takes one clock cycle and a miss takes 300 clock cycles. A load or
store hit takes one extra clock cycle on a unified cache. Compare the memory access time of two
computers, computer A has a unified cache and computer B has separate instruction and data
caches. The miss rate on the unified cache of computer A is 4%, for computer B the data cache
has a miss rate of 6% and the instruction cache 1%. Assume 70% of memory accesses are
instruction references.
pf3

Partial preview of the text

Download Cache Problems for Assignment - Computer Architecture | CSC 520 and more Assignments Computer Architecture and Organization in PDF only on Docsity!

Computer Architecture CSC 520 Cache Problems 1.Assume you have 128 blocks of cache memory, into which block or blocks of cache could main memory block 151 possibly be placed ( assume cache and memory blocks are numbered from zero ) if cache is: a. direct mapped b. fully associative c. 4-way set associative d. 8-way set associative e. Can you explain the three cache miss types? 2.Assume the instruction execution cycle on your machine could be divided into the following functions which require the amount of time indicated : IF….12ns, ID…..5ns, EX…..12 ns, Mem 15 ns, WB 4 ns. Assume pipeline overhead is 1ns. What would be the cycle time on the unpipelined machine? What would be the cycle time on the pipelined machine? What would be the (ideal) speedup due to pipelining? 3.What is Amdahl’s Law?

  1. Given a computer that requires 200 seconds to execute a particular program, the machine spends 70% of its time on floating point operations, 20 % on integer operations, and 10 % on string manipulation. If you improve one of the operations by a factor of 5, which would you chose and what will be the performance of the improved machine relative to the original machine?
  2. Assume that a cache hit takes one clock cycle and a miss takes 300 clock cycles. A load or store hit takes one extra clock cycle on a unified cache. Compare the memory access time of two computers, computer A has a unified cache and computer B has separate instruction and data caches. The miss rate on the unified cache of computer A is 4%, for computer B the data cache has a miss rate of 6% and the instruction cache 1%. Assume 70% of memory accesses are instruction references.
  1. Assume we have a pipelined machine with a structural hazard. The ideal CPI, ignoring the hazard is 1. Data references constitute 40% of the mix. Further assume that the clock rate of the machine with the hazard is 1.2times faster than this machine designed without the hazard. Disregarding any other performance losses, is the pipelined machine with or without the hazard faster and by how much?
  2. Given a computer that requires 210 seconds to execute a particular program, the machine spends 4% of its time on floating point operations, 30 % on integer operations, and 3 % on string manipulation. How much should you improve fp operations to improve the performance of the modified machine relative to the original machine by 50%?
  3. Assume your machine has a two-level cache, further, assume in 100 memory references, 5 miss the L1 cache and 2 miss the L2 cache. First, what are the various miss rates, local and global. L1 global _______________________ L1 Local _______________________ L2 global _______________________ L2 Local _______________________ c. Using the miss rates above, what is the average memory access time assuming the L2 miss penalty is 200 cycles, the L2 hit time is 20 cycles, and the L1 hit time is 1 cycle Improving Cache Performance: Figure 5.9… Summary of Performance Equations in this Chapter CPUexec time = ( CPU clock cycles + Memory stall cycles) * clock cycle time Memory stall cycles = Number of misses * miss penalty Memory stall cycles = IC * Misses / instruction * miss penalty Misses / Instruction = Miss rate * memory accesses / instruction Average Memory Access time = hit time + miss rate * miss penalty CPU execution time = IC * (CPIexecution + memory stall clock cycles / inst. ) * clock cycle time CPU execution time = IC * (CPIexecution + miss rate * miss penalty) * clock cycle time CPU execution time = IC * (CPIexecution + miss rate * memory accesses / inst. * miss penalty ) * clock cycle time Average memory access time = hit timeL1 + miss rateL1 * (hit timeL2 * miss penaltyL2) Memory stall cycles / inst. = missesL1 / inst. * hit timeL2 + missesL2 / inst. * miss penaltyL2)