Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
Tentamen (uitwerkingen)

University of California, Riverside CS 153 hw3-questions with verified answers

Beoordeling
-
Verkocht
-
Pagina's
5
Cijfer
A+
Geüpload op
16-08-2021
Geschreven in
2021/2022

Hw 3 (a) What are the physical addresses for the following virtual addresses? (i) 2,20 so the 2 is the segment and 20 is the offset so we check for number 2 has limit of 100 which doesn’t applied here and with base of 70 so 20+70 = 90 so the physical address is 90 (ii) 0,330 so the 0 is for the segment and 330 the offset which scheck the limit which is 600, which is not over bcause we hace 330 so now 330+ 400 is 730 as the physical address. (b) What is one advantage for paging over segmentation and vice versa? Paging have the down side of external fragmentation. Segmentation can be faster its supported by hardware. II. (a) An OS is using two­level paging to implement a 28­bit virtual address space per process. The page size is 256­bytes, and the machine does not have a TLB. Explain the steps involved in looking up the virtual address 0x03bf04d, when all pages are present in memory. (2 points) First, we will need 8 bits for the 256 bytes offset and 20 bits for the VPN. The page directory is has 14 bits and 6 for the page table. To look up the OS firs looks to the firs 14 bits and finds the physical address of page in the table. Now looks up the PTE for that page that it found. Finds the the physical address which then applies to the offset (b) For the system above, what is the maximum number of page faults that could be generated in response to a memory access? (2 points) only one page fault because the PTE or PDE has a bit that stops it

Meer zien Lees minder
Instelling
Vak

Voorbeeld van de inhoud

Hw 3

(a) What are the physical addresses for the following virtual addresses?

(i) 2,20

so the 2 is the segment and 20 is the offset so we check for number 2 has limit of 100 which
doesn’t applied here and with base of 70 so 20+70 = 90 so the physical address is 90



(ii) 0,330




m
er as
so the 0 is for the segment and 330 the offset which scheck the limit which is 600, which is not




co
over bcause we hace 330 so now 330+ 400 is 730 as the physical address.




eH w
o.
(b) What is one advantage for paging over segmentation and vice versa?
rs e
ou urc
Paging have the down side of external fragmentation. Segmentation can be faster its supported
by hardware.
o
aC s
vi y re



II. (a) An OS is using two­level paging to implement a 28­bit virtual address space per process.
The page size is 256­bytes, and the machine does not have a TLB. Explain the steps involved in
ed d




looking up the virtual address 0x03bf04d, when all pages are present in memory. (2 points)
ar stu




First, we will need 8 bits for the 256 bytes offset and 20 bits for the VPN. The page directory is
has 14 bits and 6 for the page table. To look up the OS firs looks to the firs 14 bits and finds the
is




physical address of page in the table. Now looks up the PTE for that page that it found. Finds the
the physical address which then applies to the offset
Th




(b) For the system above, what is the maximum number of page faults that could be generated in
response to a memory access? (2 points)
sh




only one page fault because the PTE or PDE has a bit that stops it.




This study source was downloaded by 100000827039679 from CourseHero.com on 08-16-2021 05:20:45 GMT -05:00


https://www.coursehero.com/file/35353093/hw3docx/

, III. Consider a virtual address system with the following parameters. • The memory is byte
addressable.
• Virtual addresses are 15 bits wide.
• Physical addresses are 13 bits wide.

• The page size is 128 bytes.
• The TLB is fully associative with 16 total entries.

Recall that a fully associative cache has just one set of entries—The tag field is simply the
VPN and we need to search the full TLB to check if the VPN we are seeking is in the TLB. In
the following tables, all numbers are given in hexadecimal. The contents of the TLB and the
page table for the first 16 virtual pages are as follows. If a VPN is not listed in the page table,
assume it generates a page fault.

(a) Which bits represent the VPO, the VPN? (1 point)




m
er as
Since the page table size is 128 that’s 2^8 so the VPO is bits [6:0] or the first 8 bits and the




co
VPN is the las 8 bits or the [15:7]




eH w
(b) For the virtual address 0x0422, indicate the physical address. If there is a page fault,




o.
rs e
enter “—” for the PPN and Physical Address. All answers should be given in
hexadecimal. (1 points)
ou urc
There is not hit in the TLB so then we move on too the page table which is also a miss so it’s a
page default. We have to called the OS to bring the informations. So x22 is the physical address
o

and — thePPN
aC s
vi y re



(c) Repeat for address 0x02F1 (1 points)
ed d
ar stu




The PPN is 19 and it is valid so the physical address is 0x19F1

IV. Consider a process that has been allocated 5 pages of memory: P1, P2, P3, P4, and P5. The
process accesses these pages in the following order:
is
Th




P1 P2 P3 P4 P1 P2 P5 P1 P2 P3 P4 P5

(i) Illustrate Belady’s anomaly by precisely describing the execution of the FIFO page
eviction algorithm in two cases: a) where the machine has 3 pages of physical
sh




memory, and b) where the machine has 4 pages of physical memory, and by
comparing the number of page faults incurred in these two cases. (When the process
begins executing, none of its pages are present in memory.) (2 points)




This study source was downloaded by 100000827039679 from CourseHero.com on 08-16-2021 05:20:45 GMT -05:00


https://www.coursehero.com/file/35353093/hw3docx/

Geschreven voor

Vak

Documentinformatie

Geüpload op
16 augustus 2021
Aantal pagina's
5
Geschreven in
2021/2022
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

€9,27
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
Examhack Stanford University
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
301
Lid sinds
4 jaar
Aantal volgers
238
Documenten
999
Laatst verkocht
1 week geleden
EASY A GRADE!!

Here, you will find simple, articulate well-researched education material for you. .... ALL WORK HAS PASSED WITHOUT NEEDING REVISIONS AND BY THE RUBRIC.

3,8

61 beoordelingen

5
31
4
11
3
5
2
4
1
10

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen