Write a program that is passed a virtual address in decimal


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

Solution Preview :

Prepared by a verified Expert
Programming Languages: Write a program that is passed a virtual address in decimal
Reference No:- TGS01497272

Now Priced at $50 (50% Discount)

Recommended (90%)

Rated (4.3/5)