2
\$\begingroup\$

I have a simple segmentation system with the following segment table:

Starting Address    Length (bytes)
660                 248
1752                422
222                 198
996                 604

Determine the physical address for the following logical addresses; indiciate segment faults. I know the answers, but I don't understand how they were calculated:

a. 0, 198  --  858
b. 2, 156  --  378
c. 1, 530  --  seg fault
d. 3, 444  --  1440
e. 0, 222  --  882
\$\endgroup\$
2
  • \$\begingroup\$ (1) This looks like a homework. Initial effort not demonstrated. (2) This question doesn't deal with electronics design, as far as I can tell. \$\endgroup\$ Oct 22, 2014 at 2:30
  • 4
    \$\begingroup\$ No, Nick, the answers are known to the poster, it's the concept they are admirably trying to grasp - much better than the reverse case. And this is typically a hardware design problem - an MMU is a part of the processor or board circuitry. In this simple case it consists of a lookup table, a comparator and an adder. \$\endgroup\$ Oct 22, 2014 at 4:10

2 Answers 2

2
\$\begingroup\$
a) 660 + 198 = 858
b) 222 + 156 = 378
c) 530 > 422
d) 996 + 444 = 1440
e) 660 + 222 = 882
\$\endgroup\$
1
\$\begingroup\$

First, you have to check if (offset < segment limit) for problem. If it is, add offset + base address for the physical address. If it is not, a segment fault will occur.

a) (0, 198) we will check 198< 248, which is true so we will calculate Physical address = 660+ 198 = 858.

b) (2, 156) we will check 156< 198, which is true so we will calculate Physical address = 222+ 156= 378.

c) (1, 530) we will check 530< 422, which is false so segment fault occur.

d) (3, 444) we will check 444< 604, which is true so we will calculate Physical address = 996+ 444= 1440

e) (0, 222) we will check 222< 248, which is true so we will calculate Physical address = 660+ 222= 882

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.