0
votes

Not sure if this is legal because it's homework, but oops:

Consider a logical address space of 256 pages with a 4-KB page size, mapped onto a physical memory of 64 frames. 

a. How many bits are required in the logical address? 

b. How many bits are required in the physical address? 

For logical address my guess is 20bits (8 to represent 256 pages; 12 to represent 4096 offset) HOWEVER, I noticed that they're asking for bits rather than bytes; does this mean that I'd actually need 12*8 extra bits to account for the offset...? Then again, each bit in an address should probably map to the location of a byte, so probably not.

Is the physical address just however many bits it takes to represent 64 * 4096 bytes?

1

1 Answers

1
votes

If the memory is byte addressable, then,

# bits in logical address = 20 bits

# bits in physical address = 18 bits

Explanation There is something called addressable unit for a memory. This is the smallest individual measurement by which you can access the memory.

i,e if your memory is of 32 Bytes and addressable unit is Byte, then you need 5 bits to represent each of the memory unit (1 byte here). Because we have 32 such units and log(32)2 = 5

if your memory is of 32 Bytes and addressable unit is bit, then you need 8 bits to represent each of the memory unit (1 bit here). Because we have 32*8 such units and log(256)2 = 8

Since in your question the addressable unit is not mentioned, we can consider it as byte addressable(Most common one)