Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

Assignment set number 01

Contents
Assignment Description:........................................................................................................................1
Instructions............................................................................................................................................2
Direct mapped Cache (5 marks)............................................................................................................3
Set Associative mapping (4 marks)........................................................................................................4
Fully associative cache mapping (4 marks)............................................................................................5

Assignment Description:
The assignment aims to provide deeper understanding of cache by analysing it’s
behaviour using cache implementation of CPU- OS Simulator. The assignment has three
parts. 
 Part I deals with Cache Memory Management with Direct Mapping
 Part II deals with Cache Memory Management with Set Associative Mapping
 Part III deals with Cache Memory Management with Associative Mapping

 Submission: You will have to submit this documentation file and the name of the file should
be GROUP-NUMBER.pdf. For Example, if your group number is 1, then the file name
should be GROUP-1.pdf. 

Submit the assignment by 27th Jan 2022, through canvas only. File submitted by any means
outside CANVAS will not be accepted and marked. 

In case of any issues, please drop an email to the course faculty Mr. Balamurali Shankar
(sbmurali@wilp.bits-pilani.ac.in).

Caution!!! 

Assignments are designed for individual groups which may look similar and you may not
notice minor changes in the assignments. Hence, refrain from copying or sharing documents
with others. Any evidence of such practice will attract severe penalty. 
Evaluation:
 The assignment carries 13 marks
 Grading will depend on
o Contribution of each student in the implementation of the assignment 
o Plagiarism or copying will result in -13 marks 
Instructions
************************FILL IN THE DETAILS GIVEN BELOW**************
Assignment Set Number:

Group Name:

Contribution Table:
Contribution (This table should contain the list of all the students in the group. Clearly
mention each student’s contribution towards the assignment. Mention “No Contribution” in
cases applicable.)

Sl. No. Name (as appears in ID NO Contribution


Canvas)
Simulator  software to be used for assignment.

Link to download: https://teach-sim.com/downloads/

CPU-OS Simulator 7-5-50.zip

Screenshots, Results, observations and justifications will be the outcome that will be evaluated. 

Further instructions are in assignment document.

Submit by date - Jan 27

Direct mapped Cache (5 marks)


Enter the following program in CPOS simulator and observe, analyse and report metrics in
the sub questions with screenshots.
A. Direct mapped Cache. Select Cache type as “Instruction”. Click show-cache. Under cache-
control window, Change Cache mapping to “Direct mapped”, block size to 4, cache size to 4.
 Report the number of misses, hits and compute the hit ratio. – (3 marks)
 Provide necessary screen shots. – (1 mark)

B. Direct mapped cache. Select cache type as “instruction”. Click show-cache. Under Cache-
control window, change cache mapping to “Direct mapped”. Retain block size as 4. Keep
changing cache size to achieve optimal hit ratio. Provide necessary screen shots. Explain
what changed and how it impacted hit ratio. – (2 marks)

Set Associative mapping (4 marks)


Enter the following program in CPOS simulator and observe, analyse and report metrics in
the sub questions with screenshots.
A. 2-way set associative Cache mapping. Change the mapping to 2-way set associative
mapping. Keep block size as 2, cache size as 4. Report the total hits and misses. – (2
marks)
B. Tune parameters such as block size, cache size and Replacement methods to get the
best hit ratio. – (2 marks)
 Provide parameter and hit ratio screenshots.
 Explain how it got better.
 Compare and contrast different replacement algorithms and their effectiveness
with respect to this example.

Fully associative cache mapping (4 marks)

Enter the following program in CPOS simulator and observe, analyse and report metrics in the sub
questions with screenshots.
A. Fully Associative Cache mapping. Change the above mapping to Fully associative
mapping. Keep block size as 2, cache size as 4. Report the total hits and misses. – (2
marks)

b. Tune parameters such as block size, cache size and Replacement methods to get the
best hit ratio. – (2 marks)
 Provide parameter and hit ratio screenshots.
 Explain how it got better.
 Compare and contrast different replacement algorithms and their effectiveness
with respect to this example.

You might also like