65.2k views
3 votes
We have a byte-addressable toy computer that has a physical address space of 512 bytes and the virtual address space of 2 KB. The page size is specified as 8 bytes and the page table is always in physical memory.

(a) Determine the size of each page table entry in bits if each entry contains 2-bit for flags (a valid bit, and a dirty bit) in addition to physical page number. Show all details to get full credit.
(b) What is the maximum size of the page-table in bytes? Show all details.

User Nuthinking
by
7.7k points

2 Answers

5 votes

Final answer:

To determine the size of each page table entry in bits, we need to consider the size of the physical page number, the valid bit, and the dirty bit. The size of each page table entry would be 11 bits. The maximum size of the page table would be 352 bytes.

Step-by-step explanation:

To determine the size of each page table entry in bits, we need to consider the size of the physical page number, the valid bit, and the dirty bit. The physical page number is determined by the physical address space, which is 512 bytes. Since the page size is 8 bytes, we can represent the physical page number using 9 bits (2^9 = 512).

The valid bit and dirty bit each require 1 bit, so the size of each page table entry would be 9 bits for the physical page number + 1 bit for the valid bit + 1 bit for the dirty bit, totaling 11 bits. To calculate the maximum size of the page table in bytes, we need to consider the virtual address space. The virtual address space is 2 KB, which is 2048 bytes. Since the page size is 8 bytes, we can divide the virtual address space by the page size to get the number of virtual pages (2048 / 8 = 256 pages).

Each page table entry corresponds to a virtual page, so the maximum size of the page table would be the number of virtual pages multiplied by the size of each page table entry. With 256 virtual pages and 11 bits per entry, the maximum size of the page table would be 2816 bits or 352 bytes.

User Soonts
by
7.7k points
5 votes

Final answer:

The size of each page table entry is 8 bits or 1 byte. The maximum size of the page table is 256 bytes.

Step-by-step explanation:

To determine the size of each page table entry in bits, we first need to calculate the number of bits required for the physical page number. Since the physical address space is 512 bytes and the page size is 8 bytes, we can divide the physical address space by the page size to get the number of physical pages: 512 bytes / 8 bytes = 64 physical pages. This means we need 6 bits to represent the physical page number (2^6 = 64).

Since each page table entry also contains 2 bits for flags (valid bit and dirty bit), the total size of each page table entry is 2 bits (for flags) + 6 bits (for physical page number) = 8 bits or 1 byte.

To calculate the maximum size of the page table in bytes, we need to multiply the number of virtual pages by the size of each page table entry. The virtual address space is 2 KB, which is equal to 2 * 1024 bytes. The page size is 8 bytes, so the number of virtual pages is 2 * 1024 bytes / 8 bytes = 256 virtual pages. Multiplying the number of virtual pages by the size of each page table entry gives us the maximum size of the page table: 256 virtual pages * 1 byte = 256 bytes.

User Compo
by
8.5k points