Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how long is a memory address typically in bits

I am confused with so many terminologies that my instructor talks about such as word,byte addressing and memory location.

I was under the impression that for a 32-bit processor, it can address upto 2^32 bits, which is 4.29 X 10^9 bits (NOT BYTES).

The way I think now is:

The memory is like an array of buckets each of 1 byte length.

when we say byte addressing (which I guess is the most common ones), each char is 1 byte and is retrieved from the first bucket (say for example). for int the next 4 bytes are put together in little-endian ordering to compute the Integer value.

so each memory, I see it as, 8 bits or 1 byte, which can give upto 2^8 locations, this is far less than what cpu can address.

There is some very basic mis-understanding here on my part which if some experts can explain in simple terms that a prosepective CS-major student can it in once forever.

I have read various pages including this one on word and here the unit of address resolution is given as 8b for ARM, which adds more to my confusion.

like image 226
eagertoLearn Avatar asked Jan 17 '14 22:01

eagertoLearn


People also ask

How many bits is a memory address?

Each address identifies a single byte (eight bits) of storage.

How long is a 32-bit address?

A 32-bit address is the address of a single byte. Thirty-two wires of the bus contain an address (there are many more bus wires for timing and control). Sometimes people talk about addresses like 0x2000, which looks like a pattern of just 16 bits. But this is just an abbreviation for the full 32-bit address.

What is a 32-bit address?

32-bit addressing involves computers that can locate memory addresses that are 32-bits (4 bytes) wide, allowing for a theoretical maximum of 4 gigabytes of memory, though logic board and CPU configurations may add other limitations.


1 Answers

The processor uses 32 bits to store an address. With 32 bits, you can store 2^32 distinct numbers, ranging from 0 to 2^32 - 1. "Byte addressing" means that each byte in memory is individually addressable, i.e. there is an address x which points to that specific byte. Since there are 2^32 different numbers you can put into a 32-bit address, we can address up to 2^32 bytes, or 4 GB.

It sounds like the key misconception is the meaning of "byte addressing." That only means that each individual byte has its own address. Addresses themselves are still composed of multiple bytes (4, in this case, since four 8-bit bytes are taken together and interpreted as a single 32-bit number).

I was under the impression that for a 32-bit processor, it can address upto 2^32 bits, which is 4.29 X 10^9 bits (NOT BYTES).

This is typically not the case -- bit-level addressing is quite rare. Byte addressing is far more common. You could design a CPU that worked this way, though. In that case as you said, you would be able to address up to 2^32 bits = 2^29 bytes (512 MiB).

like image 188
TypeIA Avatar answered Oct 16 '22 15:10

TypeIA