Ask your own question, for FREE!
Computer Science 6 Online
OpenStudy (lo):

Can anyone explain and know how to do this question? What are the lowest and highest addresses in a 2^20 byte memory in which a four-byte word is the smallest addressable unit?

OpenStudy (lo):

oh this is C programming btw ><

OpenStudy (rsmith6559):

0 is the lowest address, 2^20 - 1 is the highest. The four byte addressable unit will run beyond 2^20 by a factor of either 2^12 or 2^11, depending on whether it's signed or unsigned.

OpenStudy (lo):

hmmm, can u explain? what does The four byte addressable unit will run beyond 2^20 by a factor of either 2^12 or 2^11 mean?

OpenStudy (anonymous):

The size of the memory is 2^20 bytes. The smallest addressable unit is a four-byte word. This basically means that groups of four bytes share the same address. For example: byte #3 will share the address with byte #0, byte #1 and byte #2. So four bytes share the same address. How many addresses will you need for 2^20 bytes?

OpenStudy (anonymous):

2^20 is 1,048,576. This is one megabyte, or just over a million bytes. Each memory address is the location of a "data word", which in this case is four of these bytes, so divide that number by four to see how many addresses there are: 262,144. However computers generally work from zero upwards, not from one upwards like us. So the first address is zero, leaving 262,143 others, so the highest address is 262,143.

OpenStudy (anonymous):

Assuming single-byte words, you'd have an interval from 0 to (2^20 - 1) for accessible addresses. Given that the words are actually four-bytes-wide, the interval is adjusted so that it spans from 0 to (2^20 / 4 - 1) = (2^18 - 1) addresses.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!