Thar1988
Thar1988

Reputation: 511

How to solve calculations about logical address space and physical address space?

How to calculate number of bits in logical address and physical address when logical address space of 8 pages of 1024 word each, mapped to physical memory of 32 frames?

Upvotes: 15

Views: 116086

Answers (7)

Lubeena N
Lubeena N

Reputation: 101

15 is the correct answer

i think this is correct way size of logical address space is No. of pages * Page size = 8 * 1024 = 2^3 * 2 ^10 = 2^13 No. of bits for logical address is 13

Size of Physical address space is 2^5 * 2^10 = 2^15 No. of bits for physical address is 15

Upvotes: 10

hfontanez
hfontanez

Reputation: 6168

Consider the following room/floor analogy: Each floor in a hotel contains 10 rooms. The door in each room is labeled 01, 02, 03, ..., 10. Then you get off the elevator, there is a plaque with the floor number. There are 3 floors in this hotel: floors 1, 2, and 3. Therefore, you can say that, to eliminate the ambiguity in room numbers, you concatenate the floor number to the room in the following format: floor:room. So, 1:01 is different than 2:01, or 3:01.

Viewing this graphically:

1 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 |

2 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 |

3 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 |

The floor number can be expressed with one digit. The room number can be expressed with two digits. To express the unique location of the room (floor:room concatenation), you need three digits. Replace floor with frame, and room with page.

Upvotes: 7

Vivek Saini
Vivek Saini

Reputation: 51

Offset for both pages and frames is the same to comply with design. In the problem, offset is 1024, so offset for page = offset for frame = 2^10.

Total bits needed to give logical address to each word of each page = 3+10.

Since there are 5 bits needed to uniquely define each frame,the Physical address will require 5+10 = 15 bits.

Upvotes: 5

Trying
Trying

Reputation: 14278

here i think the main memory information is not needed at all.

Given Total no of pages = 8 and page offset is 1024.

we know that logical address spaces is = total no of bits required to represent total no of pages + bits required to map page offset.

Hence total bits required = 3 (because total no of pages is 8 and to represent you need three bits) + 10 (page offset is 1024 so you need 10 bits) = 13 bits all total.

Thanks.

Upvotes: 3

galaxy
galaxy

Reputation: 31

size of logical address space is No. of pages * Page size = 8 * 1024 = 2^3 * 2 ^10 = 2^13 No. of bits for logical address is 13

Size of Physical address space is 2^5 * 2^10 = 2^15 No. of bits for physical address is 15

Upvotes: 3

Bilal
Bilal

Reputation: 61

There are 8 pages in logical address space so, 2^3 = 8 then page size of 3-bits
We have 1024 words(1 word = 2-bytes) then, 1024 * 2 = 2048 bytes
which we can say that 2^11 = 2048 then so there are 11 + 3 = 14-bits are the total number of bits in a logical address.
Now coming towards the Physical address:
we have 32 frames so 2^5 = 32 we have 5-bits for frame + 11 bits = 16-bits
then we have 16-bits for our physical address.

Upvotes: 6

Thar1988
Thar1988

Reputation: 511

After searching the internet, i could find the solution for the question.

Each page/frame holds 1K; we will need 10 bits to uniquely address each of those 1024 addresses. Physical memory has 32 frames and we need 32 (2^5) bits to address each frames, requiring in total 5+10=15 bits. A logical address space of 8 pages requires 3 bits to address each page uniquely, requiring 13 bits in total.

this tutorial will provide more details regarding this question

Upvotes: 2

Related Questions