1 / 3

Quiz3 - Answer 1

Quiz3 - Answer 1. The CPI (Cycles Per Instruction) for the first program is the sum of the frequency of each instruction type multiplied by the instruction type: 0.17*7 + 0.63*4 + 0.10*12 + 0.10*3 = 5.21 For the second program the CPI is 1 as each and every instruction takes 1 cycle. Answer 2.

raoul
Download Presentation

Quiz3 - Answer 1

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Quiz3 - Answer 1 • The CPI (Cycles Per Instruction) for the first program is the sum of the frequency of each instruction type multiplied by the instruction type:0.17*7 + 0.63*4 + 0.10*12 + 0.10*3 = 5.21 • For the second program the CPI is 1 as each and every instruction takes 1 cycle.

  2. Answer 2 • 16KB = 4K word = 1K blocks = 210 blocks, thus there are 10 index bits, each block is 16 bytes (128 bits) so there are 4 offset bits. This leaves 18 bits of tag. Add a valid bit for each block we have.1K*(128 + 18 + 1) = 147KBits = 18.4KB • If the cache is 4-way set associative the number of sets is 1K/4 = 256 = 28, thus there are only 8 index bits which means the tag is 20 bits. But there are still 1K block so the number of bits in the cache is:1K(128 + 20 + 1) = 149Kbits = 18.6KB

  3. Answer 3, 4 • AMAT = (hit ratio * hit time) + (miss ratio * miss penalty)AMAT = 0.95*1 + (1-0.95) * AMAT of L2AMAT = 0.95 + 0.05*(0.92*4 + 0.08*12) = 1.182 • For the AMAT to be 1.0 the L1 hit ratio must be 100%. • The hit ratio for a 4 word block is 75% as each item is read once but reading an item brings in to the cache it’s following 3 items. i and sum are probably in registers so now memory isn’t accessed when they are read or written. • For every miss there are 7 hits. 7/8 = 87.5%

More Related