exam2-f09 - Full Name: CSCI 2400, Fall 2009 Second Midterm...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Full Name: CSCI 2400, Fall 2009 Second Midterm Exam Instructions: Make sure that your exam is not missing any sheets, then write your full name on the front. Put your name or student ID on each page. Write your answers in the space provided below the problem. If you make a mess, clearly indicate your final answer. This exam is OPEN BOOK and you can use a single page of notes. You can not use a computer or calculator. Good luck! Problem Page Possible Score 1 1 20 2 2 20 3 3 20 4 6 20 5 8 20 Total 100
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CSCI-2400-Fall 2009 -1- November 10, 2010 1. [ 20 Points ] The following problem concerns basic cache lookups and layouts. In all the problems, the memory is byte adressable, and memory accesses are all to bytes (not words). (a) [ 5 Points ] If the cache is 4-way set associative, with an 8-byte block size and 512 total bytes, label the parts of the address uses as the block offset (BO) within the line, the cache set index (CI) and the cache tag (CT). 11 10 9 8 7 6 5 4 3 2 1 0 (b) [ 5 Points ] If the cache is 2-way set associative, with a 4-byte block size and 256 total bytes, label the parts of the address uses as the block offset (BO) within the line, the cache set index (CI) and the cache tag (CT). 11 10 9 8 7 6 5 4 3 2 1 0 (c) [ 5 Points ] Assume you’re designing a cache for a computer that will mainly be used to run workloads with strong spatial locality. For a cache of a given size, what attribute of the cache is likely to be the most important? (d) Assume that it takes 200 CPU cycles to access main memory, and two cycles to access data from the cache. i. [ 2 Points ] What is average number of cycles per memory reference when using a cache that has a 95% hit rate. ii. [ 3 Points ] You’re able to either a) decrease the cache access time to 1 cycle; or, b) double the size, increasing the hit rate to 99%; or, c) decrease the memory access time to 100 cycles. Which alternative is better? CSCI-2400-Fall 2009 -1- November 10, 2010
Background image of page 2
CSCI-2400-Fall 2009 -2- November 10, 2010 2. [ 20 Points ] The following program implements matrix transposition . float m[4][4] = { {2, 1,-1, 8}, {-3, -1, 2, -11}, {-2, 1, 2, -3}, {10, -2, 4, 8} }; for (int i = 0; i < rows; i++) { for (int j = i+1; j < cols; j++) { float t = m[i][j]; m[i][j] = m[j][i]; m[j][i] = t; } } You should assume: Floats take 4 bytes. Stores to memory do not cause cache misses if the address memory is not already in the cache.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/07/2010 for the course CSCI 2400 taught by Professor Grundwald during the Fall '08 term at Colorado.

Page1 / 9

exam2-f09 - Full Name: CSCI 2400, Fall 2009 Second Midterm...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online