Block Replacement(cont)

The following applet lets you play with different replacement policies.

If you choose Direct-Mapped Method the choice of replacement policy will not affect the process. Choosing Fully-Associative Method lets you select different replacement policies and find the best one for the reference string. You can modify the reference string and construct one that takes advantage of a particular replacement policy.
In the text area you can see the history of replacements made.

As a result you can obtain the total number of references, number of hits and misses for a given string.

You are allowed to choose cache size just to experiment with the idea of improving the hit ratio while increasing the cache size. The example of applying FIFO algorithm to reference string: 0 1 2 3  0 1 4 0 1 2 3 4 with cache sizes 3 blocks and 4 blocks will give you a strange result.
Challenge: Try to construct a similar example for LRU replacement algorithm!