Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 13th, 2005, 11:09 AM   #1
sriramph
Newbie
 
Join Date: Jul 2005
Posts: 2
Rep Power: 0 sriramph is on a distinguished road
Can anyone help me on this

Consider the following two dimensional array in a paged virtual memory:
var A : array [1..50] of array [1..100] of integer;

It is assumed that the page size of the paged virtual memory is 100 words and an integer occupies exactly one word. The virtual address of A[1][1] is 100. Thus array A occupies the range in virtual memory from the beginning of page 1 to the end of page 50. In page 0 (location 0..99) there is a small program for manipulating the array. We assume that page 0 is preloaded and stored in a frame that is locked (i.e., page 0 will never be replaced).

How many page faults are generated by the following array initialization loops, using LRU replacement, with two extra free frames allocated to the process for storing data in array A. In each case, show the page reference string corresponding to the order of access to the elements in the array. Explain your answers. Redo the question when OPTIMUM replacement is use.

(i) for i := 1 to 50 do
for j :=1 to 100 do
A[i][j] := 0;
(ii) for i := 1 to 100 do
for j :=1 to 50 do
A[j][i] := 0;
sriramph is offline   Reply With Quote
Old Jul 13th, 2005, 11:19 AM   #2
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,473
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
Damn. This is a shame, the second homework question you posted... so let me repeat...

Try to do your homework assignments yourself, you will learn better that way. If you are still stuck, ask specific questions.
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Jul 13th, 2005, 11:31 AM   #3
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Doing your homework for you would ultimately be a disservice to you. But we promise not to page-swap out your post!
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Jul 13th, 2005, 11:41 AM   #4
Berto
Programming Guru
 
Join Date: Aug 2004
Posts: 1,022
Rep Power: 6 Berto is on a distinguished road
Send a message via AIM to Berto Send a message via MSN to Berto
7

and 7
__________________
"Put your hand on a hot stove for a minute, and it seems like an hour. Sit with a pretty girl for an hour, and it seems like a minute. THAT'S relativity."

- Albert Einstein
Berto is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:56 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC