Cheap and Secure Web Hosting Provider : See Now

[Solved]: Bytes and bits conversion?

, , No Comments
Problem Detail: 

It is claimed in my textbook that

In a 32-bit system, The instruction LDR r4,[r6] lets you address a logical space of 4GB.

I know where the 4GB comes from, It is simply 2^32 / (1024 x 1024 x 1024).

However, My question is why is it bytes and not bits ?

Why when we raise 2^32, we should talk about bits and not bytes. And so 4GB doesn't make sense to me .

For me It would make sense if it is (2^32/8)/ (1024 x 1024 x 1024)

Asked By : alkabary

Answered By : D.W.

That's because memory is usually byte-addressed. The address that you load from is an address of a byte in memory. Each address refers a different byte in memory. For a 32-bit address, there are $2^{32}$ different possibilities for the address, so $2^{32}$ different bytes that the address could refer to (and no overlap among these bytes). $2^{32}$ is equal to 4GB.

If we had a hypothetical machine where memory was bit-addressible, then it would indeed be 4Gb, i.e., 4 gigabits instead of 4 gigabytes -- but no one builds machines that way today.

Best Answer from StackOverflow

Question Source : http://cs.stackexchange.com/questions/45464

3.2K people like this

 Download Related Notes/Documents

0 comments:

Post a Comment

Let us know your responses and feedback