Discussion in 'Homework Help' started by zulfi100, Feb 22, 2013.

1. ### zulfi100 Thread Starter Active Member

Jun 7, 2012
465
1
Hi,
Kindly guide me with the following question:
I know for 1k we need 10 address lines. So for 2k it would 11. For 4k it would be 12. And for 8k, it should be 13. Is 13 correct answer?

Zulfi.

2. ### Papabravo Expert

Feb 24, 2006
11,985
2,572
Yes, and the formula is:

ciel(log_2(M))

where M is the size of the memory [in words or other addressable units]
log_2 is the logarithm to the base 2
ciel is the ceiling function, which is also known a smallest integer which is larger than or equal to the argument

Last edited: Feb 22, 2013
3. ### WBahn Moderator

Mar 31, 2012
23,847
7,378
But you need to recognize that M is the number of addressable words in memory, not the size of the memory. In this case, the total memory is 32kB or 256kb, but neither of those matter because there are 8k words and it is the words that are being addressed.

4. ### Papabravo Expert

Feb 24, 2006
11,985
2,572
I did recognize that of course. Why did you assume I was talking about something else?

5. ### WBahn Moderator

Mar 31, 2012
23,847
7,378
No. No. I had no doubt that you recognized it. I was just making the point explicit for the OP, who may or may not have caught the distinction. I suspect they did, since they got the right answer for the right reason, but some other noob coming across this thread may not.

6. ### zulfi100 Thread Starter Active Member

Jun 7, 2012
465
1
Hi,
This means that the answer would be 13 even for the above memory dimensions.

Zulfi.

7. ### WBahn Moderator

Mar 31, 2012
23,847
7,378
Yes, if the memory is byte-addressable, which it sounds like that is what you are talking about.

8. ### takao21203 AAC Fanatic!

Apr 28, 2012
3,682
491
If you use real memory chips, you can see this information in the datasheet.

Counting always starts with 0.

It is simply 2 EXP number of bits.

255 - 1 byte - 8 bit (256 different values)
65535 ((2x 256 )- 1) - 2 byte - 1 word - 16 bit (65536 values)

This zero or one offset is a big trap for beginners.

9. ### WBahn Moderator

Mar 31, 2012
23,847
7,378
This is quite a tangent from the discussion, are you sure you replied to the thread you thought you were?

10. ### takao21203 AAC Fanatic!

Apr 28, 2012
3,682
491
Not so much tangent as the address bit numbers don't automatically correspondend to the actual memory size.

It depends.

To me it is quite obvious OP did not read even one single memory IC datasheet.

Maybe it is a school question.

Memory on a piece of paper without any context or purpose.

If OP also writes WHY he wants to know about that?

11. ### takao21203 AAC Fanatic!

Apr 28, 2012
3,682
491
I suggest to examine such a datasheet.
If there is something not understood, read it again.
Most datasheets contain all the relevant information somehow wrapped.

File size:
171.7 KB
Views:
34
File size:
40.9 KB
Views:
34
12. ### WBahn Moderator

Mar 31, 2012
23,847
7,378
The OP's question was just fine and there was sufficient info to answer the question and he did it right. There's no need to run to a data sheet to answer a question like this and if someone's level of understanding is such that they did need to run to a data sheet, then their fundamentals are seriously in question. Besides, the data sheet you posted isn't for a RAM that matches the question. It is an 8kB and his question uses a 32kB RAM. Both simply have 8k of addressable words and therefore need 13 address lines.

13. ### takao21203 AAC Fanatic!

Apr 28, 2012
3,682
491
Yes I maybe did not understand the question properly.

An 8K 32bits deep RAM normally is composed from 8bit RAM chips. There are also 16bit RAMs but 32bit 8K RAMs are not known to me.