What are the physical addresses for the following logical addresses
Before you go through this article, make sure that you have gone through the previous article on Segmentation in OS. Show
We have discussed-
In this article, we will discuss a practice problem based on segmentation.
PRACTICE PROBLEM BASED ON SEGMENTATION-
Problem-
Consider the following segment table- Segment No.BaseLength012197001230014290100313275804195296
Which of the following logical address will produce trap addressing error?
Calculate the physical address if no trap is produced.
Solution-
In a segmentation scheme, the generated logical address consists of two parts-
We know-
Option-A: 0, 430-
Here,
We have,
Now,
Option-B: 1, 11-
Here,
We have,
Now,
Option-C: 2, 100-
Here,
We have,
Now,
Option-D: 3, 425-
Here,
We have,
Now,
Option-E: 4, 95-
Here,
We have,
Now,
Thus, Option-(C) is correct.
To watch video solution and practice other problems, Watch this Video Lecture
Next Article- Segmented Paging in OS
Get more notes and other study material of Operating System. Watch video lectures by visiting our YouTube channel LearnVidFun. Summary Article Name Segmentation in OS | Practice Problems Description Practice Problems based on Segmentation in OS. Segmentation in OS is a non-contiguous memory allocation technique. Unlike Paging, Segmentation divides the process into segments. Physical Address identifies a physical location of required data in a memory. The user never directly deals with the physical address but can access by its corresponding logical address. The user program generates the logical address and thinks that the program is running in this logical address but the program needs physical memory for its execution, therefore, the logical address must be mapped to the physical address by MMU before they are used. The term Physical Address Space is used for all physical addresses corresponding to the logical addresses in a Logical address space. What will be the physical addresses for the given logical addresses?The Logical Address is generated by the CPU while the program is running and the Physical Address is the location inside the main memory. The Logical Address is Virtual and the Physical Address is the actual address of the memory.
How to find physical address from logical address in segmentation?Segment 0, Logical Address is 430 - So physical address becomes - 219+430 = 649 b. Segment 1, Logical Addres is 10 - So physical address becomes - 2300+10 = 2310.
What is physical & logical address?Logical and physical addresses are important terms. The logical address is rendered by CPU while a program is executed, whereas the physical address directs to a location in the memory unit. Let's figure out some major differences between logical and physical addresses.
How many logical address can a physical address have?Just as the number 4 can be named as 0+4 , 1+3 , 2+2 , etc., the address 12345 can be expressed as 1234:0005 , 1233:0015 , 1230:0045 , and so on. In other words, each physical address has 64k different logical addresses.
|