Write a program in C/C++ running in the Debian VM environment tosimulate the functions of a paging system. There are 16 pages inthe VAS and 8 frames in the PAS. The page size (and frame size) is256 bytes. You MUST use the LRU algorithm shown in class to handlepage replacement in main memory.
Your program will read virtual addresses stored in a file namedaddresses.txt and translate them to their corresponding physicaladdresses. The addresses.txt file will be provided to you later totest your program. Note that the addresses.txt file containsvirtual addresses ranging from 0 to 4095 (inclusive) (This is therange of the VAS because there are 16 pages in the VAS, each ofwhich has 256 bytes). These virtual addresses are stored in thefile in such a way that each of them is stored on a separate lineterminated with a ‘n’ character.
When a virtual address is read from the addresses.txt file, itspage number portion is determined and indexed into the page table.The following shows the two possible cases after the page number isdetermined.
Answer to Write a program in C/C++ running in the Debian VM environment to simulate the functions of a paging system. There are 16…