Cache access assignment - 60 points

Due Friday 10 April 2015 - In class by start of class.

Below is a representation of the 1st 32 bytes of main memory with a string of characters stored in it.

The assignment requires you to show the contents of the cache after each of a series of reads are performed. The order of reads is determined by using the numeric portion of your zid to generate the read sequence.

On the work sheets (accessible via the link below) you will find a snapshot of the real memory with the data filled in.

The main memory contains the following :

Memory @   0  1   2  3   4  5   6  7   8  9  10 11  12 13  14 15
Data This -is- data -for
Memory @  16 17  18 19  20 21  22 23  24 25  26 27  28 29  30 31
Data -ouu -cac he-a ssig

There will also be several images of the 8 byte ( 2 cell by 2 line by 2 way) cache like the example below. Each cell in cache is 1 byte storage.

Mem @             Tag Id             Line Id             Byte Id            
segment tag cell 0 cell 1 hit/miss  
segment tag cell 0 cell 1 hit/miss
line 1





 
 

line 0





 
 

Click here to view and print three copies of the work for the assignment. Setting your fonts to Times Roman, size = 16 should allow the worksheet to print on a single page. In Firefox, you can also preview the printed page and scale to fit the page.

Sequence of memory accesses, address in hex :

0, A, 1, B, 2, C, 3, D, 18, 4, E, 5, F, 6, 10, 19, 7, 11, 8, 12, 1A, 9, 13, 1B

These will be the same as the direct cache.

Break the main memory up into cache sized segments. Draw a heavy line between each segment. Important, even though you have 2 line zeros, there is only 2 bytes on a line, so your segments are smaller. Number each segment.

Break each segment into lines to match cache and label.

Take the 1st memory location from the sequence of 18 memory addresses and write it in the Mem @ field of the cache set.. Calculate the Tag, Line, and Byte IDs and write in appropriate fields. Remember, the line is shorter in this assignment.

Next copy the byte contents from the main memory table to the appropriate cache line. If the cache line was empty, mark the Hit/Miss field as a Miss.

If the previous instance of the cache line had the the data from the same segment, mark as a Hit.

If both ways are full and neither has the segment you need, it is a miss. Use FIFO - Select the older line to replace and mark the Hit/Miss field for that way as a Miss.

Also circle the actual byte in the cached line that is being read.

Remember to copy all information from the previous cache instance that hasn't changed. Once a cache has data in it, the data does not go away. If you leave a previously filled cache line blank, it will be marked wrong.

Preceed to take the next memory address in the 18 byte read sequence and fill in the Mem@, Tag Id, Line Id, and Byte Id fields in the next cache instance. Then fill in the cache lines. Repeat for all 18 memory addresses.

Page 1 key

Page 2 key

Page 3 key