Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 552
Thar1988 Avatar asked Jun 24 '12 13:06

Thar1988


People also ask

How do you calculate total logical and physical address space?

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.

How do you calculate physical address when logical address is given?

Given a logical address; split it into pieces like: offset_in_page = logical_address % page_size; page_table_index = logical_address / page_size; Then get the physical address of the page from the page table: physical_address_of_page = page_table[page_table_index].

What is the formula to calculate the size of the logical address?

Calculation of the number of bits required for Logical Address: # Logical Address Space (LAS) = Size of process. # Logical Address Space (LAS) is divided into an equal number of pages. # Page size is always a power of 2.


2 Answers

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

like image 115
Lubeena N Avatar answered Sep 22 '22 17:09

Lubeena N


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.

like image 41
hfontanez Avatar answered Sep 22 '22 17:09

hfontanez