Question

The RISC-V 32-bit architecture supports virtual memory with 32-bit virtual addresses mapping to 32-bit physical addresse...

The RISC-V 32-bit architecture supports virtual memory with 32-bit virtual addresses mapping to 32-bit physical addresses. The page size is 4Kbytes, and page table entries (PTEs) are 4 bytes each.

Translation is performed using a 2-level page table structure. Bits 31:22 of a virtual address index the first-level page table. If the selected first-level PTE is valid, it points to a second-level page table. Bits 21:12 of the virtual address then index that second-level page table. If the selected second-level PTE is valid, it points to the physical page.

How many bytes are required for the first-level page table?

How many bytes are required for a second-level page table?

If the entire virtual address space were allocated, how many bytes would be required for page tables?

If the following ranges of virtual addresses are allocated:

  • 0x00000000 to 0x011FFFFF
  • 0x10000000 to 0x1FFFFFFF
  • 0x7FC00000 to 0x7FFFFFFF

How many bytes would be required for page tables?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

as we can see that first level page table has 10 bits so 2^(10) possible locations so we can see that it is 1024 and each entry is of 4 bytes so the total requirements is 1024*4= 4KBytes

Similarly for second level page table 10 bits are used and 4 byte per entry so 4KBytes

Size of pages = 4KB

and memory size as there are 2^20 pages possible with this address

210 * 210 * 4KB 4GB

as we can see that

  • 0x00000000 to 0x011FFFFF
    • the number of addresses are 0x011FFFFF = 1,88,74,367‬ addresses and 1 page table contains 2^10 = 1024 of such entries so
    • page tables required will be 1,88,74,367‬/1024= 18432 tables and
    • for these tables we need 18432/1024 = 18 page directories
    • So total requirement will be 18432+18 =18450 tables or 18450*4KB=73800 KB
  • 0x10000000 to 0x1FFFFFFF similarly here the number of addresses are 0x0FFFFFFF=26,84,35,455‬
    • Page tables=2,62,144
    • first level page table = 256
    • Hence the number of pages will be 262144+256 = 262400 or 1049600 KB
  • 0x7FC00000 to 0x7FFFFFFF
    • here it will be 3FF FFFF‬ = 6,71,08,863‬
    • Page tables = 6,71,08,863‬ /1024 = 65536
    • Page directory tables= 65536/1024 = 64
    • Total memory requirement = 65600 tables or 262400KB

Do give a thumbs up and in case there are doubts leave a comment.

Add a comment
Know the answer?
Add Answer to:
The RISC-V 32-bit architecture supports virtual memory with 32-bit virtual addresses mapping to 32-bit physical addresse...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • computer architecture Virtual memory 4 physice memar Assume a 64 bit machine with 40 bit addresses,...

    computer architecture Virtual memory 4 physice memar Assume a 64 bit machine with 40 bit addresses, and 16GB of actual memory. Memory blocks are 4K 1. How many bits in the virtual memory INDEX and OFFSET fields? 2. What fields do you need in a page table entry, and how many bits are needed for each? How many bytes do you need for each page table entry? (each entry is allocated in a whole number of bytes, even if there...

  • 1) Given a virtual memory system with: virtual address 36 bits physical address 32 bits 32KB...

    1) Given a virtual memory system with: virtual address 36 bits physical address 32 bits 32KB pages (15 bit page offset) Each page table entry has bits for valid, execute, read and dirty (4 bits total) and bits for a physical page number. a) How many bits in the page table? (do not answer in bytes!) Three digit accuracy is good enough. The exponent may be either a power of 2 or a power of 10. b) The virtual address...

  • 17. A computer system implements a paged virtual memory system. Assume a 16-bit virtual address space...

    17. A computer system implements a paged virtual memory system. Assume a 16-bit virtual address space and a 24-bit physical address space. Assume that the first 6 bits of a virtual address index the page table and the rest of the bits are the page offset. A process has the following indexed page table. Index Page Table Entry (PTE) 0x3800 0x3600 0x3200 0x1000 2 3 Each page table entry qives a hexadecimal page frame addresses. Translate the following two hexadecimal...

  • A computer has 32-bit virtual addresses and the page size is 2^3 KB. Suppose the text,...

    A computer has 32-bit virtual addresses and the page size is 2^3 KB. Suppose the text, data, and stack segments of a process need 5 page(s) each. If the computer uses two-level page tables, with 3 bits for the second-level index, how many page table entries (PTEs) are in each second-level page table?

  • Exercise l: Suppose that we have a virtual memory space of 28 bytes for a given process and physical memory of 4 page frames. There is no cache. Suppose that pages are 32 bytes in length. 1) How...

    Exercise l: Suppose that we have a virtual memory space of 28 bytes for a given process and physical memory of 4 page frames. There is no cache. Suppose that pages are 32 bytes in length. 1) How many bits the virtual address contain? How many bits the physical address contain? bs Suppose now that some pages from the process have been brought into main memory as shown in the following figure: Virtual memory Physical memory Page table Frame #...

  • 1. Address Layouts Our OS uses 32-bit virtual addresses, 24-bit physical addresses, and page sizes of...

    1. Address Layouts Our OS uses 32-bit virtual addresses, 24-bit physical addresses, and page sizes of 4KB. Draw the layout of both the virtual and physical addresses along with the size in bits. Please just do the drawing, that's all that is needed

  • 4. Assume that we have a machine with the following memory specifications: Virtual addresses are 32...

    4. Assume that we have a machine with the following memory specifications: Virtual addresses are 32 bits wide Physical addresses are 26 bits wide . Page size is 16 Kbytes 4/A) How many pages are in the virtual memory space? 4/B) How many page frames are in the physical memory space? 4/C) If each page table entry consists of a physical frame number, 1 present/absent bit Answers Pages .Page Frames and 1 dirty/clean bit (which shows if the page has...

  • Consider a virtual memory system with the following properties: 36 bit virtual byte address, 8 KB...

    Consider a virtual memory system with the following properties: 36 bit virtual byte address, 8 KB pages size, and 32 bit physical byte address. Please explain how you determined your answer. a. What is the size of main memory for this system if all addressable frames are used? b. What is the total size of the page table for each process on this processor, assuming that the valid, protection, dirty, and use bits take a total of 4 bits and...

  • ​Suppose you have a byte-addressable virtual address memory system with 8 virtual pages of 64 bytes each

    Suppose you have a byte-addressable virtual address memory system with 8 virtual pages of 64 bytes each, and 4-page frames. Assuming the following page table, answer the questions below: Page #Frame #Valid Bit0111312-03014215-06-07-0a) How many bits are in a virtual address? b) How many bits are in a physical address? c) What physical address corresponds to the following virtual addresses (if the address causes a page fault, simply indicate this is the case)? 1) Ox00 2) 0x44 3) OxC2 4) 0x80

  • Virtual memory address translation: a) Consider a machine with a physical memory of 8 GB, a...

    Virtual memory address translation: a) Consider a machine with a physical memory of 8 GB, a page size of 4 KB, and a page table entry size of 4 bytes. How many levels of page tables would be required to map a 52-bit virtual address space if every page table fits into a single page? b) Without a cache or TLB, how many memory operations are required to read or write a page in physical memory? c) How much physical...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT