HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

What is the maximum directly adddressable memory capacity?

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
themaximumwhatadddressablecapacitydirectlymemory

Problem

This is taken from OPERATING SYSTEMS: INTERNALS AND DESIGN PRINCIPLES by WILLIAM STALLINGS

Consider a 32-bit microprocessor composed of 2 fields: the first byte contains the opcode and remainder an immediate operand or an operand address.
What is the maximum directly addressable memory capacity?

Now the answer should be 2^24=16777216 bits = 2 megabytes but the solution set says 2^24=16 MBytes

So am I wrong or is the solution set wrong?

Solution

Start with a simpler example. Suppose you only had 3 address bits, rather than 24. With $3$ bits we could have $2^3=8$ addresses: 000, 001, 010, 011, 100, 101, 110, 111. In this case, we could think of memory as being divided up into 8 chunks, of equal sizes, with one address per chunk:

memory:  chunk 0 | chunk 1 | chunk 2 | chunk 3 | chunk 4 | chunk 5 | chunk 6 | chunk 7
address:   000       001       010       011       100       101       110       111


For example, the contents of chunk 3 would be addressed by the three bits 011. Now how much memory would there be in total? It'll clearly be 8 times the size of a chunk. Stalling is using a memory model where the chunks are bytes, so with 3-bit addresses, we would have a total memory of $2^3=8$ bytes: one byte per address.

A different computer, though, might be built so that each chunk was 4 bytes. On such a machine with 3-bit addresses we would have $8\times 4 = 32$ bytes of memory, 4 bytes per address.

At any rate, with 24-bit addresses, we'd have $2^{24}= 16777216 = 16\text{M}$ possible addresses, hence that many possible chunks. If each chunk was a byte that would mean that the total addressable memory would be 16777216 bytes, or 16MB. Similarly, if each chunk was 4 bytes long, the total addressable memory would be (chunk size $\times$ number of addresses), or $4\text{B}\times 16\text{M} =64\text{MB}$.

Code Snippets

memory:  chunk 0 | chunk 1 | chunk 2 | chunk 3 | chunk 4 | chunk 5 | chunk 6 | chunk 7
address:   000       001       010       011       100       101       110       111

Context

StackExchange Computer Science Q#28915, answer score: 5

Revisions (0)

No revisions yet.