37.3k views
5 votes
Suppose you have a 16-bit machine with a page size of 16B. Assume that any unsigned 16-bit integer can be a memory address. Also, assume that the machine can support up to only 32KB of physical memory. (1K = 210)

Required:
For paging-based memory allocation, how many page table entries do you need to map the virtual address space of a process, with pure paging alone?

User Lauris
by
3.5k points

2 Answers

5 votes

Final answer:

To determine the number of page table entries needed in a 16-bit machine with 16B page size and a virtual address space of 64KB, divide the total address space by the page size, resulting in 4096 entries.

Step-by-step explanation:

To calculate the number of page table entries required for a paging-based memory allocation, we should understand the memory address space and page size. In a 16-bit machine, there are 216 possible addresses, making the virtual address space 64KB in size. Since the page size is 16B (16 bytes), we can calculate the total number of pages by dividing the virtual address space by the page size.

The calculation is as follows:

  • Virtual address space: 216 addresses
  • Number of pages = Virtual address space / Page size
  • Number of pages = 64KB / 16B
  • Number of pages = (216 bytes) / 16 bytes
  • Number of pages = 216 / 24 = 212 = 4096

Therefore, you would need 4096 page table entries to map the virtual address space of a process using pure paging alone.

User James Dellinger
by
3.0k points
2 votes

Answer:

2^11

Step-by-step explanation:

Physical Memory Size = 32 KB = 32 x 2^10 B

Virtual Address space = 216 B

Page size is always equal to frame size.

Page size = 16 B. Therefore, Frame size = 16 B

If there is a restriction, the number of bits is calculated like this:

number of page entries = 2^[log2(physical memory size) - log2(n bit machine)]

where

physical memory size = 32KB which is the restriction

n bit machine = frame size = 16

Hence, we have page entries = 2^[log2(32*2^10) - log2(16)] = 2ˆ[15 - 4 ] = 2ˆ11

User Bela
by
3.5k points