© Paul Koester, Dallas County Community College, 2018
COSC 2425 – Computer Organization
Lab #6 – Virtual Memory
Create a Java program which translates a virtual address to a physical address for a hypothetical
computer. The input is a text file with a list of 16-bit virtual addresses in Hexadecimal. The output is a
text file with the corresponding physical addresses. Each page fault will also result in a message to the
console. This computer is byte-addressable with 16-bit virtual addresses, 2KB of physical memory, and
a 256 byte page size. It uses a FIFO page replacement policy.
Requirements
1. The program must be written in Java.
2. It reads Hexidecimal address from the virtual.txt file and writes physical addresses to the
physical.txt file.
3. When a page is not in physical memory. A page fault occurs. The program must display a
message to the console indicating which page (if any) was swapped out of physical memory and
which physical memory frame the new page was loaded into.
4. To implement the FIFO page replacement policy a queue is required. You may implement the
queue yourself or use the one provided by the Java API.
Hint: The UML Class diagram below describes one way to organize the program.
Extra Credit (up to 10 points)
In addition to using the FIFO replacement policy, run the same data using an LRU policy. Calculate and
display the hit ration for that.
© Paul Koester, Dallas County Community College, 2018
Upload: Your Java source file (.java)
Sample Output
Last few lines of console output for provided virtual.txt
Page Fault: Page 1f loaded in frame 4 replaces page 1e
Page Fault: Page 17 loaded in frame 5 replaces page 14
Page Fault: Page 14 loaded in frame 6 replaces page 21
Page Fault: Page 21 loaded in frame 7 replaces page e
Page Fault: Page 15 loaded in frame 0 replaces page 1d
Page Fault: Page 13 loaded in frame 1 replaces page 11
Page Fault: Page 18 loaded in frame 2 replaces page 20
File physical.txt closed
Hit ratio: 0.49047619047619045
1441
1fb9
1629
14e3
1f7b
1a2c
141a
20bd
1945
14b9
1fcb
1844
14ed
2068
186f
1673
202a
1838
12e4
20ec
196a
109c
1d4b
1272
1505
1e61
189b
1038
1ee0
1594
1318
21ee
158c
1094
1f5b
1777
15d7
1f03
1843
127c
2254
11f7
12ff
1dec
16a1
1621
2187
171d
134e
212f
1682
16a9
1f26
13fa
14c3
220b
1544
1351
1fd9
1573
1727
2015
16ca
1120
2190
16c3
134c
20de
144b
137c
216a
1617
156b
209c
17a0
1436
1d21
1782
10fb
21da
159a
12b2
2096
1880
1642
2001
143b
1381
203e
1711
136f
1f56
176d
1246
1f54
156c
1202
220f
1861
1287
23ef
153e
11c6
1f45
1672
1436
2116
1861
1126
20c6
1a45
118b
1f71
1679
1229
2108
1698
117c
2121
1820
1338
1fac
1894
150e
1ff6
1714
12ef
212c
1802
10ce
1a76
1785
dc2
2007
18f4
1433
2048
148e
1125
1fd4
1961
1080
1dc6
1825
149d
1f16
192e
13a3
1f5c
10b7
17aa
1e4f
1ab1
100a
200b
151a
13ea
1f15
12af
1259
1e93
18a3
18e2
1efb
17de
1718
1fa1
16cd
10bd
2156
18e0
1564
2249
1ac5
1849
1dce
173e
116e
1f9a
1700
1320
1ff0
1594
152e
1f96
1815
1197
1ecd
1456
117f
21ed
1469
ecb
1d55
1503
1155
203a
18a8
1247
1faa
176f
14cc
2157
174e
15eb
202f
1796
138d
21cb
181f
Why Choose Us
- 100% non-plagiarized Papers
- 24/7 /365 Service Available
- Affordable Prices
- Any Paper, Urgency, and Subject
- Will complete your papers in 6 hours
- On-time Delivery
- Money-back and Privacy guarantees
- Unlimited Amendments upon request
- Satisfaction guarantee
How it Works
- Click on the “Place Order” tab at the top menu or “Order Now” icon at the bottom and a new page will appear with an order form to be filled.
- Fill in your paper’s requirements in the "PAPER DETAILS" section.
- Fill in your paper’s academic level, deadline, and the required number of pages from the drop-down menus.
- Click “CREATE ACCOUNT & SIGN IN” to enter your registration details and get an account with us for record-keeping and then, click on “PROCEED TO CHECKOUT” at the bottom of the page.
- From there, the payment sections will show, follow the guided payment process and your order will be available for our writing team to work on it.