title: How to calculate the miss rate of Data and Instruction Caches
body: <h2>The Situation</h2>
  
  <p>I'm trying to answer an architecture question on instruction and data caches I have found in a past exam paper (<strong>not homework!</strong>).</p>
  
  <p>The question seems to give a lot of information which I haven't used in my solution. This makes me think I'm missing something and would be really grateful if someone could help me out!</p>
  
  <h2>The (Full) Question</h2>
  
  <p>This is the full question as asked in the paper. For a summary of key points please see below.</p>
  
  <blockquote>
    <p>Calculate the miss rate for a machine S with separate instruction
    cache and data cache, each of n bytes. There are <code>I</code> misses per <code>K</code>
    instructions for the instruction cache, and d misses per k
    instructions for the data cache.</p>
    
    <p>A fraction <code>X</code> of instructions involve data transfer, while a fraction
    <code>Y</code> of instructions contain instruction references, the rest contain
    data references. A hit takes <code>H</code> cycles and the miss penalty is <code>M</code>
    cycles.</p>
  </blockquote>
  
  <h2>Key Question Points</h2>
  
  <p><strong>Given</strong>:</p>
  
  <ul>
  <li>Data and instruction caches are separate</li>
  <li>Each cache has <strong><code>N</code></strong> bytes</li>
  <li><strong><code>I</code></strong> misses per <strong><code>K</code></strong> instructions for instruction cache</li>
  <li><strong><code>D</code></strong> misses per <strong><code>K</code></strong> instructions for the data cache</li>
  <li>A fraction <strong><code>X</code></strong> of the instructions involve <strong>data transfer</strong></li>
  <li>A fraction <strong><code>Y</code></strong> of the instructions involve <strong>instruction references</strong></li>
  <li>The rest of the instructions contain <strong>instruction references</strong></li>
  <li>A hit takes <strong><code>H</code></strong> cycles</li>
  <li>The miss penalty is <strong><code>M</code></strong> cycles</li>
  </ul>
  
  <p><strong>Calculate</strong>: Miss Rate of Machine</p>
  
  <h2>Attempts so far</h2>
  
  <p>I originally thought that the miss rate would be <code>(I/K)*Y + (D/K)*(1 - X - Y)</code> but since this doesn't use all the data provided, I don't think it can be right :(.</p>
  
  <p>Any help would be awesome!</p>