Memory Pagination Simulator
Project
Specifications
Language: Java JDK 8
Input data: http://traces.cs.umass.edu/index.php/CpuMem/CpuMem
Pagination size: 2¹² = 4096 bytes (4MB)
Number of bits to displacement: 12 bits
Number of bits to address: 20 bits
Size of logic adress: 32 bits
Use
The program may be call using:
java -jar program.jar [file][method|all][number of frames][size]
Where:
-
java -jarInvokes the JRE to run the program. -
program.jarThe built program location. -
fileThe input file.
4.method|all Select which method will be executed (fifo or optimal).
-
number of framesThe user select how many frames the memory has. -
sizeThe size of each page in bytes, the input consists of an integer which represents a power of two number, but has a default value if the user does not put it.
The input file is a txt available on Specification:
B5E723DC
B5E723DC
FEDD98DD
B5E723DC
B5E723DC
B5E723DC
B5E723DC
B5E723DC
This represents the memory access, after will be implemented an reference string considering the paging size and address.
In case of the input value does not have 8 hexadecimal digits which represents 32 bits, the program fills zeros while the size of values are less than 8.
Output
Are expected two differents outputs
- Page Substitution
---------------------------------------
| Deallocated | Allocated |
---------------------------------------
| Page 1 | Page 2 |
---------------------------------------
- Final Results
Method: FIFO
Number of frames: 8
Page size: 4096
Offset: 12 bits
Address: 20 bits
----------------------------------------
| Number of page fault | 20 |
----------------------------------------