Write a program in VS C++2017 to determine the tag, set number,and offset for a memory address of a system supporting an N-wayset-associative cache.Your program should first read in theinformation for N,memory capacity (in bytes), block/line size (inbytes), cache capacity (in bytes), and a memory address(indecimal). It then does the necessary mapping and displays theresult to the screen.You may assume that all the informationentered is power of 2 except the memory address. The followingshows a scenario of running a sample program, where user’s inputsare represented in boldface.
Enter N: 4
Enter memory capacity:512
Enter block/line size: 8
Enter cache capacity: 128
Enter a memory address:
OR
OR