Docsity

Computer Systems Organization Homework 5 for CS433ug, Assignments of Computer Architecture and Organization

Toggle sidebar
bg1
CS433ug: Computer Systems Organization Spring 2007
Homework 5
Assigned: 4/3
Due in class 4/19
Instructions:
Please write your name, NetID and an alias on your homework submissions for posting grades (If you don’t
want your grades posted, then don’t write an alias). We will use this alias throughout the semester.
Homeworks are due in class on the date posted.
1. [12 points] Cache Simulation Consider a 2-way set associative 512 byte L1 data cache. The
processor has uses has a 32 bit address space and uses 32 bit words. 1 block is 4 words. This cache is
write-back, write allocate and uses LRU to replace cache entries. The system is byte addressable.
(a) How many bits are needed for the index? tag? offset? [3 points]
(b) Fill in the table and specify hits or misses and what bus activity is required (read, write, both or
none). The cache is initially empty (all blocks are invalid) and addresses are in hex. [5 points]
Address (Operation) Hit? . Bus Accesses
1 AD6A 2120 (Load)
2 23FE 1136 (Store)
3 AD6A 2128 (Store)
4 05AD AA1C (Load)
5 167A 4126 (Load)
6 FA41 051A (Store)
7 1234 AB20 (Store)
8 34AC 7322 (Load)
9 05AD AA12 (Store)
10 FA41 0512 (Load)
(c) Fill in the first 4 sets of the cache as they would look at the end of the above operations. [4 points]
Set Tag 1 . V 1 D 1 Data 1 Tag 2 . V 2 D 2 Data 2
0 XXXXXX XXXXXX
1 XXXXXX XXXXXX
2 XXXXXX XXXXXX
3 XXXXXX XXXXXX
1
pf3

Partial preview of the text

Download Computer Systems Organization Homework 5 for CS433ug and more Assignments Computer Architecture and Organization in PDF only on Docsity!

CS433ug: Computer Systems Organization Spring 2007 Homework 5 Assigned: 4/ Due in class 4/

Instructions: Please write your name, NetID and an alias on your homework submissions for posting grades (If you don’t want your grades posted, then don’t write an alias). We will use this alias throughout the semester. Homeworks are due in class on the date posted.

  1. [12 points] Cache Simulation Consider a 2-way set associative 512 byte L1 data cache. The processor has uses has a 32 bit address space and uses 32 bit words. 1 block is 4 words. This cache is write-back, write allocate and uses LRU to replace cache entries. The system is byte addressable.

(a) How many bits are needed for the index? tag? offset? [3 points] (b) Fill in the table and specify hits or misses and what bus activity is required (read, write, both or none). The cache is initially empty (all blocks are invalid) and addresses are in hex. [5 points] Address (Operation) Hit?. Bus Accesses 1 AD6A 2120 (Load) 2 23FE 1136 (Store) 3 AD6A 2128 (Store) 4 05AD AA1C (Load) 5 167A 4126 (Load) 6 FA41 051A (Store) 7 1234 AB20 (Store) 8 34AC 7322 (Load) 9 05AD AA12 (Store) 10 FA41 0512 (Load) (c) Fill in the first 4 sets of the cache as they would look at the end of the above operations. [4 points] Set Tag 1. V 1 D 1 Data 1 Tag 2. V 2 D 2 Data 2 0 XXXXXX XXXXXX 1 XXXXXX XXXXXX 2 XXXXXX XXXXXX 3 XXXXXX XXXXXX

  1. [10 points] AMAT Consider an in-order execution MIPS processor that runs at 1.0 GHz with a split L1 cache and a unified L2 cache. Assume the following: - The CPI of the processor with no L1 misses is 0.7. - Reads are 20% and writes are 5% of all instructions respectively. - The I-cache is 32k, has a 2% miss rate and 32 byte blocks and is direct mapped. - The D-cache is 32k, is a no write allocate, write through cache with a 5% miss rate and 16-byte blocks and is direct mapped. There is also a write buffer so there are no stalls for 95% of all writes. - The L2 cache is a 512k, write-back, write-allocate, unified cache with 64-byte blocks and an access time of 15ns. It has a 20% missrate. 50% of all blocks replaced are dirty for the L2. - The L1 and L2 caches are connected by a 128-bit bus that runs at 266 MHz and can transfer one 128-bit word per bus cycle. - The L2 cache takes 60ns to access main memory after which data may be transfered at the rate 128-bits/cycle on the 133Mhz main memory bus.

Show all of your work for each of the following questions, so that students with cascading errors can still be given partial credit. Don’t forget to account for time to transfer data as well as access times and writing back dirty blocks.

(a) What is the average memory access time for instruction accesses? (b) What is the avereage memory access time for data reads? (c) What is the average memory access time for data writes? (d) What is the overall CPI, including memory accesses?

  1. [8 points] Cache Improvements

(a) What is way prediction and why does it increase cache performance? [1 point] (b) Suppose we have a direct mapped 1024 byte cache with 16 byte blocks. Consider the following code: A is a 128 element integer (4 bytes) array. //increment first half of array and decrement second half for(i = 0; i < 64; i += 2) { A[i] = A[i] + 1; A[i+64] = A[i+64] - 1; } Does this code perform well with the given cache? Why or why not? (c) Would modifying the cache to be a psuedoassociative cache improve performance of the code in part c? Why or why not? (d) Would adding a victim cache improve the performance of the code in part c? Why or why not?