Lab Instruction
Assume that a system has a 32-bit virtual address with a 4-KB page size (12bits).
Write a program that is passed a virtual address (in decimal) via the attached txt file and have it output the page number and offset for the given address in the command line. The program should mask page number and offset from an unsigned 32-bit address.
A memory reference appears as:
|------------|-----|
31 12 11 0
As an example, your program would run as follows:
./mm input.txt
Number of Translated Addresses: 456
Address PageNumber Offset
16916 4 532
62493 15 1053
.....
printf("***DONE***\n");
Submission Instruction:
1. Test your code.
2. Take a screenshot of the first and last page of your output and save them in a PDF file as YourCSUNID_YourLastName.pdf.
3. Upload your source code.
Attachment:- Input_File.txt