I just had the following question in an exam and was a bit lost with how to solve it. How would I go about making the requested calculations?
"A paging system uses 48-bit addresses, each of which specifies 1 byte (B) of memory. The system has a main memory unit of 512MB, and a page size of 16KB. Answer the following questions:
a) How many frames does the system memory contain?
b) How many bits does the system use to maintain displacements (i.e offsets), and how many bits does the system use to maintain page numbers?"
For the first part, I converted 512MB into KB (1MB = 1024KB):
512MB = 524288KB
I then divided the main memory unit size by the page size:
524288 / 16 = 32768 frames.
This was my best logical guess as to how to compute the frame size, I could be completely off.
I had no idea where to even start with computing the number of bits to maintain displacements and page numbers.
a) How many frames does the system memory contain?
Number of frames= Physical Address space / frame size
= 512MB / 16KB
= 2^29 /2^14
= 2^15
= 32K frames
b) How many bits does the system use to maintain displacements (i.e offsets), and how many bits does the system use to maintain page numbers?"
Number of pages= Logical address space / page size
= 2 ^48 / 2^14
= 2 ^ 34
= 16G pages.
Number of bits for page number=34
Number of bits for offset= 14 bits i.e. (48-34)