ECE243 Practice Question Website


Main Assembly Programming Input/Output Memory Computer Architecture Advanced Topics

Memory Questions





Question 14

Given the following cache and cache configuration:

TAG SET OFFSET
6 2 2
2-way set associative
4 byte cache line
32 byte cache
10 bit address
Assume a write-back cache
Assume that the cache will replace data in block 0 before lines in block 1 when replacement is required for this question.

Block# Tag (binary) Data (3..0) Valid Dirty
Set Index = 0 0 010110 A5 06 72 B4 0 0
1 010010 A5 06 72 B4 0 0
Set Index = 1 0 010110 3A 59 BC 94 0 1
1 010111 3A 59 BC 94 1 1
Set Index = 2 0 111111 FF FF FF FF 1 0
1 110011 19 FD E4 FF 1 0
Set Index = 3 0 100100 A4 4A 56 65 1 1
1 000011 A4 4A 56 65 0 1

For each of the following memory operations fill in the blocks given with the result of the operation on the cache. Use MM to indicate unknown data fetched from memory.
The entry below is completed for you as an example of what to do.

Operation: CPU reads from $360
Hit(H) or Miss(M):  M Fetch from memory?    No X Yes, from $360 to $363
--Result-- Block# Tag (binary) Data (3..0) Valid Dirty
Set Index = 0 0 110110 MM MM MM MM 1 0


Operation: CPU reads from $376
Hit(H) or Miss(M):  Fetch from memory?    No    Yes, from      to    
--Result-- Block# Tag (binary) Data (3..0) Valid Dirty
Set Index =          

Answer

Operation: CPU reads from $376
Hit(H) or Miss(M):  M Fetch from memory?    No X Yes, from $374 to $377
--Result-- Block# Tag (binary) Data (3..0) Valid Dirty
Set Index =1 0 110111 MM MM MM MM 1 0