To calculate the average access time (AAT) of the system, we need to consider the access time of the cache, main memory, and the time taken to write the data back to memory.
Given:
- Cache access time (Tc) = 80 nanoseconds
- Main memory access time (Tm) = 200 nanoseconds
- Percentage of read requests (Pr) = 85%
- Hit ratio for read access (Hr) = 0.9
- Write-through scheme is used
To calculate the average access time for read requests, we can use the following formula:
AAT_read = Tc + (1 - Hr) * Tm
Here, (1 - Hr) represents the miss ratio for read requests.
Substituting the given values, we get:
AAT_read = 80 + (1 - 0.9) * 200 = 100 nanoseconds
To calculate the average access time for write requests, we need to take into account the time taken to write the data back to memory. Since write-through scheme is used, the write request must update both the cache and main memory.
AAT_write = Tc + Tm
Therefore, the average access time for write requests is:
AAT_write = 80 + 200 = 280 nanoseconds
To calculate the overall average access time (AAT), we need to take into account the percentage of read and write requests. Since 85% of requests are for read and 15% are for write, we can use the following formula:
AAT = Pr * AAT_read + (1 - Pr) * AAT_write
Substituting the values, we get:
AAT = 0.85 * 100 + 0.15 * 280 = 121 nanoseconds
Therefore, the average access time of the system for both read and write requests is 121 nanoseconds.