Assuming that a system has a 32-bit virtual address, write a Java program that i
ID: 3773720 • Letter: A
Question
Assuming that a system has a 32-bit virtual address, write a Java program that is passed:
• The size of the page,
• The virtual address.
Your program will report the page number and offset of the given virtual address within the specified page size. Page sizes must be specified as a power of 2 within the range 1024- 16384 (inclusive). Assuming such a program is named Address, it would run as follows:
java Address 4096 19986
And the correct output would appear as:
The address 19986
contains: Page number = 4
Offset = 3602
Explanation / Answer
C++ code:
JAVA code:
import java.io.*;
public static void main(String[] args) {
OR