I'm interested in how does cpu read 32 bit word from memory .If the processor has 32 bits of address space then it can address 4,294,967,295 locations (or 4 gb) Does this mean that each location has 32 bits.?
-
$\begingroup$ What do you mean by "how"? $\endgroup$– RaphaelCommented Feb 16, 2018 at 11:16
-
$\begingroup$ Modern computers are byte addressable. Each address refers to one 8-bit byte. When the processor wants to load/store a larger size, consecutive addresses are accessed. The memory understands these larger requests: several different transfer sizes can be requested as part of the cpu-memory bus protocol. $\endgroup$– Erik EidtCommented Feb 18, 2018 at 1:04
1 Answer
Address Space and Word Size are indeed two different things. If my processor has an $n$ bit address space, then it can address $2^n$ addresses. Note that this is merely the number of addresses and is not $2^n$ GB.
The word size of a memory refers to the size of the smallest addressable unit of the memory. In other words if my processor has an $n$ bit address space and a word-size of $b$ bytes, then my processor can address $2^n$ locations each of which are $b$ bytes long.
-
1$\begingroup$ Addresses are often byte-based even if the machine word is larger. $\endgroup$ Commented Feb 16, 2018 at 12:52
-
$\begingroup$ That cleared up a preconceived notion. Thanks. $\endgroup$– SagnikCommented Feb 16, 2018 at 17:38