In Progress

Write a program in C++ to implement LRU, FIFO and OPTIMAL replacement policies in a cache. Assume that the cache has only one set.

The binary should accept four arguments, as follows:

./binaryName LRU [login to view URL] NumberOfCacheEntries

Your program should create output file such as RollNumber_LRU_AddressSequenceFile_ NumberOfCacheEntries.out.

For example, if we run

$./binaryName OPTIMAL [login to view URL] 8

and your roll number is CS13B1011, then, output file should be named [login to view URL]

The maximum number of addresses in input file will be 50,000. Maximum number of CacheEntries we will test for is 1024. So, if you are using fixed-size arrays, you can write the code accordingly.

The addresses may be strings and not necessarily numbers. The addresses may be separated by space or newline. We will not test your program with any incorrect input, except one: the AddressSequenceFile may have some empty lines or spaces anywhere in the file. Your program should be robust to this.

We will test your algorithm using our inputs files. Two sample AddressSequenceFile are attached to test your submission ([login to view URL] and [login to view URL]). In these files, each entry shows the address/location which are accessed.

Submission: The name of your submitted file MUST be [login to view URL], e.g., CS15BTECH99999_CacheEmulation.cpp.

You need to upload your code as a single C++ source file, which can be compiled and run with g++ without using any flags. For sake of avoiding compilation issues, do not use c++11 features. Use of STL (e.g., vector, find, etc.) is acceptable.

Output: Your program should print everything in output file. In such a file, the first four lines should be

TOTAL_ACCESSES = 1000

TOTAL_MISSES = 800

COMPULSORY_MISSES = 69

CAPACITY_MISSES = 731

Of course, your numbers may be different than 1000/800/69/731.

After these lines, print HIT or MISS on a new line, depending on whether the address hit or missed in the cache. Sample output files (corresponding to the input files) are also attached.

Skills: C Programming, C# Programming, C++ Programming, Java, Software Architecture

See more: fifo page replacement program, programs simulate page replacement algorithms fifo optimal lru, write program implement integers digit arrays, lru cache c++ stl, optimal page replacement algorithm, lru page replacement algorithm in java, lru algorithm in java, what is lru cache, lru page replacement algorithm in c, least recently used, lru algorithm, write program implement single source shortest path problem, write program implement circular linked list, write program page replacement algorithm fifo, write program optimal page replacement algorithm, write program simulate fifo page replacement algorithm, write program simulate lru page replacement algorithms, write program simulate fifo lru page replacement algorithms, write program implements fifo lru page replacement algorithms, write program implements fifo lru

About the Employer:
( 1 review ) Hyderabad, India

Project ID: #17797806

9 freelancers are bidding on average ₹3311 for this job

₹3888 INR in 3 days
(356 Reviews)
7.2
agragaurav

Hi, I have a master's degree in computer science, over 15 years of experience, and I'm a published author of books on Data Structures & Algorithms, and Computer Programming. I routinely help graduate/post-gradate st More

₹15000 INR in 3 days
(14 Reviews)
5.4
roshanasim

I have worked with PLCs, FPGAs, mikrocontrollers, single-board computers, robotic arms, etc. I have a high knowledge of Matlab/Octave, Python, Simulink, C, mikroC and Arduino, PLC programming: LD, ST, FBD/CFC, SFC a More

₹1625 INR in 1 day
(15 Reviews)
4.6
kalyanprakash4

keen to do it, please discuss, negotiable price and duration

₹2250 INR in 3 days
(22 Reviews)
4.4
ashishcompwiz

Hi, I am expert in PHP, Wordpress, HTML, .NET, Android & iOS, with 3+ years in mobile application development field and also almost 5+ years in website designing field. I am a well experienced web and mobile programmi More

₹1500 INR in 1 day
(3 Reviews)
2.9
Zthewab

I am expert in C++ .I will complete your project within time .so kindly consider my proposal for your project.

₹850 INR in 1 day
(0 Reviews)
0.0
₹750 INR in 1 day
(0 Reviews)
0.0
bitwiz

Hi, I have 10+ years experience, have worked with top software product companies as software engineer. I am computer engineer from one of the best institutes in country. Your problem seems to be an interesting one as i More

₹600 INR in 2 days
(0 Reviews)
0.0
₹3333 INR in 7 days
(0 Reviews)
0.0