# What in a computer determines how much memory a memory address holds?

In my notes, I found the following quotes from unknown sources:

a byte-addressable 32-bit computer can address 2^32 = 4,294,967,296 bytes of memory, or 4 gibibytes (GiB).

a system with a 32-bit address bus can address 2^32 (4,294,967,296) memory locations. If each memory address holds one byte, the addressable memory space is 4 GB.

what is it in a computer to determine how much memory a memory address holds, i.e., whether the computer is byte-addressable, word-addressable, or xxxx-addressable? Is it the RAM itself, CPU, or something else?

Note: My question has nothing to do with programming. I think it is different from programming perspective, where the amount of memory that the address of an object hold depends on its data type (int, float, ...).

Thanks!

-
@Ramhound: Do you mean "xxx-addressable" is determined by CPU instruction set? – T... Dec 25 '13 at 4:23
Do note that the concept of "word" is also architecture-dependent. That said, this did bring back quite a few memories (no pun intended)... – Michael Kjörling Dec 25 '13 at 22:13

Without going into the technical details (which I would get wrong anyway), the computer hardware itself is designed and built so that each address refers to a byte, or 2 bytes, or 4 bytes, or whatever. The operating system has no choice in the matter; it must be written to conform to the hardware design.

Most, probably all, computers running today are byte-addressable, and a byte is 8 bits. Past designs have been different.

The number of bits in an address determines the number of addresses. The number of bits stored at an address is specified by the design; there will be one pin and one line to carry the data. Multiply those numbers together to get the maximum number of bits that can be stored.

To answer your actual question: Is it the RAM itself - yes, CPU - yes, or something else - yes, the motherboard and chipset. All of these have to be designed to work together and they all have to agree on byte size and addressing.

-

In the old days, processors had pins, and some of those were used to communicate with memory.

You had A pins, to specify an address, and D pins, to read or write data. A typical 8-bit processor of the early 80s would have pins D0 through D7 and A0 through A15. Meaning it could address up to 2^16 8-bit (D0 through D7) bytes of memory, or 64K. 16-bit CPUs would have sixteen D lines (the m68k is an example), and 32-bit CPUs (like the Pentium) would have thirty-two.

It's possible to have a 16-bit architecture with an 8-bit external bus, or 32-bit architecture with a 16-bit external bus - there are a multiple things that determine the "bit"-ness of a CPU and data width is just one of them. Internal architecture may still be different.

Looking at the pinout (though CPUs do not have "pins" anymore, the board has pins and the CPU now has "lands") of something recent like the Core i7 - things have changed. I'm not sure what things like DDR0_DQ[63] mean - the relation between CPU and memory is complex today due to caching, NUMA, and multi-core CPUs.

So it is a combination of the CPU architecture and the physical memory interface it uses that determines this.

-
My question is not about the bit of an address, but the amount of memory that an address is addressing. – T... Dec 25 '13 at 4:24
@T... this does mention the amount of memory that the cpu is addressing. e.g. he mentions pins for specifying an address, and pins to r/w data, these are not bits of an address in memory. as for an address addressing, I think you're confused. a CPU register could perhaps be called an address in the CPU but isn't really called that. And memory addresses - addresses in memory, don't really address memory(outside of a programming language, like maybe a pointer in C, but you mean outside of programming). – barlop Dec 25 '13 at 5:31
good stuff ultra, but I suppose a question would be.. Supposing a system reads/writes 4 bytes at a time. Now, if the CPU wants to address Bytes 0-3 , then OK its MAR/ memory address register, is set to 0, is it? Now, What if it wants to address byte 4, I suppose it'd fetch bytes 4-7 but what address goes into the memory address register? 2? or 4? or some other number - what? – barlop 6 mins ago – barlop Dec 25 '13 at 5:31
"In the old days, processors had pins" -- Before microprocessors, processors and CPUs consisted of one or more boards instead of one chip. – sawdust Dec 25 '13 at 5:32

what is it in a computer to determine how much memory a memory address holds?

Good entry level question.

I would say the simple answer is the tradeoff between cost and complexity.

For example, there have been one bit computers, which addressed only one bit at a time by shifting bits in and then assembling them together, (granted that was a long time ago). They keep the wiring to a minimum. And there were 4 bit wide data word computers don't go that far back. The computer I am typing on gets a word that is 64 bits wide at a time. But note that 32 bit machines do the same thing just by getting two 32 bit wide words and assembling them together as one. Also I remember the old IBM mainframe which had about 10 different ways it could address words. But most of this was done in firmware for the program's convienence, as it was actually addressing only one size of physical memory word (to keep things simple in hardware).

So the answer is that there are lots of ways to do things and lots of ways to design things, and just about every combination in between. Cost and speed are where the decisions are made.

-
"The computer ... gets a word that is 64 bits wide at a time" -- Irrelevant to the actual question. Seems like you are confusing memory access/transfer size with the size of the memory unit at a memory address. Your PC has an address for every byte of memory. After it accesses a 64-bit word, the address for the next word is +8 the previous address. On 16-bit minicomputers I used to program, a memory read always fetched 16-bits, and address+1 fetched the next 16 bits. The CPU did not support fetching a half word or just 8 bits or a byte. – sawdust Dec 26 '13 at 7:34
Please focus on the original question which was, "...what is it in a computer to determine how much memory a memory address holds, [for example], whether the computer is byte-addressable, word-addressable, or xxxx-addressable?" – Eliptical View Dec 26 '13 at 18:30