220k views
3 votes
Consider a memory system with cache having the following parameters: S_c = 32 KB C_c = 0.1 cents/bytes T_c = 10 ns S_m = 256 MB C_m = 0.0001 cents/bytes T_m = 100 ns

A) What was the total cost prior to addition of cache?
B) What is the total cost after addition of cache?
C) What is the percentage decrease in time due to inclusion of cache with respect to a system without cache memory considering a cache hit ratio of 0.85?

User Stderr
by
7.9k points

2 Answers

4 votes

Final answer:

The question involves computing the total costs and time savings in a computer memory system with and without cache. The costs are calculated by multiplying the size by the cost per byte and adding the costs for cache. The percentage decrease in time due to cache is found using the cache hit ratio and memory access times.

Step-by-step explanation:

The question is about calculating costs and time savings in a computer memory system before and after the inclusion of a cache. To answer this, we need to understand the memory system parameters provided, such as the size and cost of memory and the access times for main memory and cache memory.

Memory System Cost Calculation

A) The total cost prior to addition of cache (S_m * C_m) is calculated by multiplying the size of main memory (S_m) with the cost per byte of main memory (C_m).

B) The total cost after addition of cache includes the cost of main memory plus the cost of cache memory, which is calculated by adding the total cost of main memory to the product of the size of cache (S_c) and cost per byte of cache (C_c).

Time Savings Calculation

C) To calculate the percentage decrease in time due to the inclusion of cache, we use the cache hit ratio and the access times for main memory (T_m) and cache (T_c). The average access time with cache can be computed using the formula: average access time = (cache hit ratio * T_c) + ((1 - cache hit ratio) * T_m). The percentage decrease in time is then computed by comparing the average access time with cache to the access time without cache.

User Squashman
by
8.3k points
6 votes

Final answer:

The total cost prior to the addition of cache is 25.6 cents. The total cost after the addition of cache is 28.8 cents. The percentage decrease in time due to the inclusion of cache is 90%.

Step-by-step explanation:

In order to calculate the total cost prior to the addition of cache, we need to multiply the size of memory (S_m) by the cost per byte (C_m). The total cost before cache can be calculated as follows:

Total cost before cache = S_m x C_m

= 256 MB x 0.0001 cents/bytes

= 256 x 10^6 bytes x 0.0001 cents/bytes

= 25.6 cents

After the addition of cache, the total cost can be calculated by adding the cost of memory (S_m x C_m) with the cost of cache (S_c x C_c). The total cost after cache can be calculated as follows:

Total cost after cache = (S_m x C_m) + (S_c x C_c)

= 256 x 10^6 bytes x 0.0001 cents/bytes + 32 x 10^3 bytes x 0.1 cents/bytes

= 25.6 cents + 3.2 cents

= 28.8 cents

To calculate the percentage decrease in time due to the inclusion of cache, we need to calculate the time difference between the memory access time without cache (T_m) and the memory access time with cache (T_c). The percentage decrease in time can be calculated as follows:

Percentage decrease in time = (T_m - T_c) / T_m x 100%

= (100 ns - 10 ns) / 100 ns x 100%

= 90%

User Isumit
by
6.9k points