Due Friday 3 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 look up the read sequence.
On the work sheets (accessible via the link below) you will find a snapshot of the real memory with data filled in.
The main memory contains the following :
Memory @ | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
Data | T | h | i | s | - | i | s | - | d | a | t | a | - | f | o | r |
Memory @ | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 1A | 1B | 1C | 1D | 1E | 1F |
Data | - | o | u | r | - | c | a | c | h | e | - | a | s | s | i | g |
There will also be several images of two tables.
A table to show the memory being accessed, and the tag, line, and byte indexes for memory being accessed. And a second table showing the 8 byte cache (2 lines by 4 bytes). Each cell in cache is 1 byte storage.
Mem @ | Tag Id | Line Id | Byte Id |
segment tag | cell 0 | cell 1 | cell 2 | cell 3 | | hit/miss | |
line 1 | | |
|||||
line 0 | | |
Click here to view and print three copies of the work for the assignment. Use print preview to make sure the web page fits in one sheet before printing.
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
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.
Next copy the byte contents from the main memory table to the appropriate cache line. If the cache line was empty or the previous instance of the cache had a line from a different segment, mark the Hit/Miss field as a Miss. Also circle the actual byte in the cached line that is being read.
If the previous instance of the cache line had the the data from the same segment, mark as a Hit.
Remember to copy the other line from the previous cache instance. 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.
Solution for 1st 3 pages of the cache.