Question

In: Computer Science

What is the function of a replacement algorithm?  Do you need a replacement algorithm for direct mapping?  ...

  1. What is the function of a replacement algorithm?  Do you need a replacement algorithm for direct mapping?  
  2. Define the two write policies in about ten sentences total. Discuss the relative merits of the policies.  
  3. Describe a simple way of implementing an LRU replacement algorithm in a 4-way set associative cache.
  4. What is the impact of the design decision of line size on hit ratio?  Discuss the various approaches of cache coherency in a multiprocessor system (in about 10 sentences).  Discuss the relative merits of unified vs. split (code/data) cache design.    

Solutions

Expert Solution

1) Firstly let us see about the Cache Replacement algorithm. This concept is mainly used to optimize the instructions or algorithm in which a computer program or hardware structure can leverage of managing a cache of computer's information stored.

Direct mapping is one of the method in mapping techniques which is used to transfer the data from main memory to cache memory. The function is very straight forward, K mod N = i

K - Main memory block number
N - Number of cache lines
i - Cache memory line number

Of course, Replacement algorithm can be used in Direct mapping.

2) There are different write policies exist in cache policies. Let's see the below two write policies in detail.

i) Write-Through Policy: It is a central caching policies is known as write-through. Here the data is stored and written into the cache and to the primary storage device at the same time. We can leverage of this policy which ensures information will be stored safely without risk of data loss. If the computer crashes or the power goes out, data can still be recovered without issue. To keep data safe, this policy has to perform every write operation twice. The program or application that is being used must wait until the data has been written to both the cache and storage device before it can proceed. This comes at the cost of system performance but is highly recommended for sensitive data that cannot be lost. Many businesses that deal with sensitive customer information such as payment details would most likely choose this method since that data is very critical to keep intact.

ii) Write-Back Policy: This is most common policy in cache policy. This is applicable only when processing of data saving. very few instances the information will be written to the storage. This policy has some drawback over Write-Through Policy. This is no guarantee to save the data safe hence data loss is very common here. System performance is quite good since it is not storing the data in cache and storage device. Data recoverability is exchanged for system performance making this idela for applications or program. so it requires low latency and high throughput.

Please let me know if you have any questions. Happy learning!


Related Solutions

Differentiate between direct mapping and associative mapping in computing memory management
Differentiate between direct mapping and associative mapping in computing memory management
Write algorithm for LIFO (Last In First Out) Page Replacement Algorithm
Write algorithm for LIFO (Last In First Out) Page Replacement Algorithm
Using what you have learned about process mapping in this week’s resources, create a process mapping...
Using what you have learned about process mapping in this week’s resources, create a process mapping flowchart to measure operational data of the activity using Microsoft PowerPoint or Microsoft Visio. Identify the important measurements within your process which provide operational data. Then, based on the process map you have created, list and describe these measurements and the critical path within your process, utilizing any additional process improvement tools necessary. Your completed Assignment should include the flowchart, a description of process...
Using what you have learned about process mapping in this week’s resources, create a process mapping...
Using what you have learned about process mapping in this week’s resources, create a process mapping flowchart to measure operational data of the activity using Microsoft PowerPoint or Microsoft Visio. Identify the important measurements within your process which provide operational data. Then, based on the process map you have created, list and describe these measurements and the critical path within your process, utilizing any additional process improvement tools necessary. Your completed Assignment should include the flowchart, a description of process...
The company will need to do replacement analysis to determine which option is the best financial...
The company will need to do replacement analysis to determine which option is the best financial decision for the company. Price Co. is considering replacing an existing piece of equipment. The project involves the following: • The new equipment will have a cost of $1,200,000, and it will be depreciated on a straight-line basis over a period of six years (years 1–6). • The old machine is also being depreciated on a straight-line basis. It has a book value of...
JavaScript Write out a function that takes in array of numbers. You do not need to...
JavaScript Write out a function that takes in array of numbers. You do not need to check if each item of the array is a number, assume this has already been done. Create a new array using the map function that that the original item and adds 4 to it. Then iterate through the new array and log each item to the console. If you do not use map it will be counted wrong. Call your function with the following...
Develop an algorithm and implement Optimal Page Replacement algorithm using C++. Determine the number of page...
Develop an algorithm and implement Optimal Page Replacement algorithm using C++. Determine the number of page faults and page hits by considering the Frame size=4, ReferenceString:2 4 6 7 8 2 4 9 13 9 2 7 2 6 1 4 9 2
You are an analytics developer, and you need to write the searching algorithm to find the...
You are an analytics developer, and you need to write the searching algorithm to find the element. Your program should perform the following: Implement the Binary Search function. Write a random number generator that creates 1,000 elements, and store them in the array. Write a random number generator that generates a single element called searched value. Pass the searched value and array into the Binary Search function. If the searched value is available in the array, then the output is...
Do you agree or disagree that strategists need to shift their focus away from direct competition...
Do you agree or disagree that strategists need to shift their focus away from direct competition and instead towards the concept of blue oceans? Explain your answer with real-world examples and be sure to provide justification for your point of view.
Why do you have to do staging and mapping when designing a data warehouse? Describe both...
Why do you have to do staging and mapping when designing a data warehouse? Describe both processes of staging and mapping. Discuss the considerations that you can take into account when deciding whether to use a staging area, or not, for the source data.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT