0
$\begingroup$

I am a bit lost calculating how much segments will the system handle in a memory segmented system (without virtual memory). The problem says that the system has a word length of 32 bits and the address are 6 hexadecimal numbers, 3 of them are the segment identifier. We have a segment size of 4KiB

I tought this:

If the address are of 24 bits wide, we could address $2^{24}$ bytes of data and our segment size is $2^{12}$ bytes. So divide them and we have the maximum number of segments our system can handle.

But I was told this isn't the way to solve this problem. Here is the way it's supposedly correct:

We have $2^{24}$ address in our system, with a length of 32 bits so we have $2 ^ {29}$ bits of addressable memory, $2 ^{16}$ KiB of addressable memory. So dividing between our segment size we have $2^{14}$ segments.

But I don't find this answer correct, because if it says that the 3 hex digits identifies the segment we have 12 bits to identify every segment, with a maximum of $2^{12}$ segments, so I don't know how the second solution manage to add 4 times more segments than my solution.

So what answer is correct?

Thanks

$\endgroup$
0
$\begingroup$

I think neither of those is a good solution, but yours is better than the one you were given.

Here's how I'd reason through it: there are 3 hex digits to represent the segment identifier. That's 12 bits for the segment identifier. 12 bits can identify up to $2^{12}$ possibilities. So the system can have at most $2^{12}$ possible segments. The rest of the information is irrelevant.

$\endgroup$
  • $\begingroup$ I thought that before the solution I posted but i was told that this reasoning was B.S. Thanks $\endgroup$ – Cako Jan 22 '17 at 17:32
  • $\begingroup$ @Cako, did whoever told you it was B.S. provide an explanation why they thought it was BS? $\endgroup$ – D.W. Jan 22 '17 at 18:12
  • $\begingroup$ who told me that provided me the second explanation. Thanks $\endgroup$ – Cako Jan 22 '17 at 18:19
  • $\begingroup$ @Cako, OK. Well, that's not an explanation why my answer is B.S. -- it's just a different proposed answer -- so I wouldn't know how to respond for that other than to ask for justification for stating that it is B.S. If you're still talking to them you might find it enlightening to ask. $\endgroup$ – D.W. Jan 22 '17 at 18:21
  • $\begingroup$ Ok. I also thought that, this is why I am asking this here $\endgroup$ – Cako Jan 22 '17 at 18:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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