USING C++:
Determine the tag, set number, and offset for a memory addressof a system supporting an N-way set-associative cache. Write aprogram that will first read in the information for N, memorycapacity (in bytes), block/line size (in bytes), cache capacity (inbytes), and a memory address (in decimal). It then does thenecessary mapping and displays the result to the screen. You mayassume that all the information entered is power of 2 except thememory address. The following shows a scenario of running a sampleprogram, where user’s inputs are represented in boldface.
Enter N: 4
Enter memory capacity: 512
Enter block/line size: 8
Enter cache capacity: 128
Enter a
OR
OR