in CO and Architecture
1,463 views
0 votes
0 votes

If a processor has 32-bit virtual address, 28-bit physical address, 2 kb pages. How many bits are required for the virtual, physical page number?

  1. 17, 21
  2. 21, 17
  3. 6, 10
  4. None

The answer given is b. 21, 17

in CO and Architecture
1.5k views

2 Answers

0 votes
0 votes
Best answer
In this case, the processor has a 32-bit virtual address and a 28-bit physical address, and the system uses 2 kb pages. The virtual address is divided into two parts: the virtual page number and the offset within the page. The physical address is also divided into two parts: the physical page number and the offset within the page.

The virtual page number is the part of the virtual address that specifies which page of virtual memory a program is accessing. The physical page number is the part of the physical address that specifies which page of physical memory the data is actually stored in. The offset is the part of the address that specifies the specific location within the page.

To determine the number of bits required for the virtual page number and the physical page number, we need to know the size of the pages and the size of the virtual and physical addresses. Since the pages are 2 kb in size, and there are 1024 bytes in a kilobyte, each page is 2048 bytes in size (2*1024). This means that the offset field of the address can be 11 bits long, since 2^11 is 2048.

Since the virtual address is 32 bits long and the offset field is 11 bits long, this leaves 32-11=21 bits for the virtual page number.

Since the physical address is 28 bits long and the offset field is 11 bits long, this leaves 28-11=17 bits for the physical page number.

Therefore, the virtual page number requires 21 bits and the physical page number requires 17 bits.
0 votes
0 votes
The correct answer is 21, 17. This is because a 32-bit virtual address has 21 bits for the virtual page number and 6 bits for the offset, while a 28-bit physical address has 10 bits for the physical page number and 18 bits for the offset.

Related questions