How many bits are needed to address this much memory?

44,279

Solution 1

A 1-bit address can address two words (0, 1).

A 2-bit address can address four words (00, 01, 10, 11).

A 3-bit address can address eight words (000, 001, 010, 011, 100, 101, 110, 111).

So first answer: How many words do you have? Then answer: How many bits does your address need in order to address them?

Solution 2

64MB = 67108864 Bytes/4 Bytes = 16777216 words in memory, and each single word can thus be addressed in 24 bits (first word has address 000000000000000000000000 and last has address 111111111111111111111111). Also 2 raised to 24 = 16777216, so 24 bits are needed to address each word in memory.

The requirement is to represent each memory word with an address, which is in bits, in such a way that each and every word can be represented.

For example, to represent 4 words, you need 4 addresses, 2 raised to 2 is 4, so you need two bits. 00 is the address of the first word, 01 is the address of the second word, 10 is the address of the third word, and 11 is the address of the 4th word.

For 8 words, you need 8 addresses, and 2 raised to 3 is 8, so 3 bits are needed. 000, 001, 010, 011, 100, 101, 110, 111 are the 8 addresses.

Solution 3

1 byte = 8 bits, so since there are 4 bytes and 1 byte = 8 bites Would it be correct to think 4bytes x 8 bites = 32 bits?? being the answer???

No, that's not the answer. If your computer has 64 MB of memory and each word is 4 bytes, how many words are there in your memory? How much bits would you need to address each word (bits needed to represent a number from 0 to number of words - 1).

Solution 4

The formula being:

log (Memory Size/Addressable Unit Size) / log 2

Example1: How many address bits are required to address 16GBytes of memory, where each addressable unit is 1 byte wide? Ans: log(16*1024*1024*1024/1)/log2 = 34 bits

Example2: How many address bits are required to address 16GBytes of memory, where each addressable unit is 2 bytes wide? Ans: log(16*1024*1024*1024/2)/log2 = 33 bits

Example3: How many address bits are required to address 64MBytes of memory, where each addressable unit is 4 bytes wide? Ans: log(64*1024*1024/4)/log2 = 24 bits

Example3: How many address bits are required to address 16MBytes of memory, where each addressable unit is 1 byte wide? Ans: log(16*1024*1024/1)/log2 = 24 bits

Share:
44,279
Daniel
Author by

Daniel

Updated on October 29, 2020

Comments

  • Daniel
    Daniel over 3 years

    I'm taking a programming fundamentals course and currently I'm on the chapter where it talks about computer organization and operations on bits - how the CPU (ALU, CU, registers, etc.) works.

    I have a fairly good understanding of the binary language. I understand sign/magnitude format/ 1's complement, 2's complement, etc.

    In the book I've learned that a nibble = 4 bits, 8 bits = 1 byte next is a word - which is usually in groups: 8 bits, 16 bits, 32 bits or 64 bits (so on), and all this makes perfect sense to me. Here's my homework question which is kind of confusing to me:

    "A computer has 64 MB of memory, Each word is 4 bytes. How many bits are needed to address each single word in memory?"

    Well, I'm confused now. The book just told me that a word is typically in multiples of 8. However I know that 1 byte = 8 bits, so since there are 4 bytes and 1 byte = 8 bytes, would it be correct to think that 4 bytes x 8 bits = 32 bits? Is this the answer?