In: Computer Science
Assume a 222 byte memory:
a. What are the lowest and highest addresses if memory is byte-addressable?
b. What are the lowest and highest addresses if memory is word-addressable, assuming a 16-bit word?
c. What are the lowest and highest addresses if memory is word-addressable, assuming a 32-bit word?
Explain with Steps please
For a memory system, which stores data in bytes, if adress is allocated to every byte then it is known as byte-addressable memory. But if address is allocated to every word (a word can be defined a group of bytes), then it is known as word-addressable memory.
Given that memory size is 222 Bytes. In order to access n bytes, log2n bits are needed. Similarly to access 222 Bytes, log2222 = 22 bits are needed. With 22 bits, the possible decimal number range is from 0 to 222 - 1.
(a) So when memory is byte-addressable, a maximum of 222 bytes will be present in memory. To distinguish these 222 Bytes, 22 bits are needed. So
(b) Given that the word size is 16-bits i.e., 2 Bytes (1 Byte = 8 bits). It means all the bytes of memory will be divided into a group of 2 bytes each, where each group is a word and address will be allocated to every word. So the memory is now containing (222 B / 1 word ) = ( 222 B / 2 B ) = 222-1 words = 221 words.
So to distinguish 221 words, log2221 = 21 bits are needed. With 21 bits, the possible decimal number range is from 0 to 221 - 1 and each of these will be allocated to a word.So
(c) Given that the word size is 32-bits i.e., 4 Bytes (1 Byte = 8 bits). It means all the bytes of memory will be divided into a group of 4 bytes each, where each group is a word and address will be allocated to every word. So the memory is now containing (222 B / 1 word ) = ( 222 B / 4 B ) = ( 222 B / 22 B ) = 222-2 words = 220 words.
So to distinguish 220 words, log2220 = 20 bits are needed. With 20 bits, the possible decimal number range is from 0 to 220 - 1 and each of these will be allocated to a word.So