5

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? – Ben 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)... – a CVn Dec 25 '13 at 22:13
8

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.

|improve this answer|||||
  • Sorry but your last paragraph is incorrect. In current commodity PCs the RAM and memory controller don't support addressing to any finer granularity than 8 bytes - 64 bits. You know how RAM modules' capacity is advertised as e.g. 128Mx64? The "64" is the size of each addressable chunk of RAM in bits, so this would be a 1 GB module. Byte addressability is handled by the CPU's firmware and cache. – Jamie Hanrahan May 5 '18 at 1:06
  • @Jamie Hanrahan: I don't follow you. How does that make anything incorrect? – user184411 Oct 11 '18 at 1:07
  • The addresses that are sent to DIMMs each refer to an 64-bit-wide chunk of memory. In other words the DIMMs do not implement addresses for each byte. In the example I gave the 128Mx64 DIMM would implement 128x1024x1024 different addresses. But in the CPU, the instruction set implements a separate address for every byte. To the CPU that same DIMM has 1 GiB of memory and each of the 1024x1024x1024 bytes has its own address. Hence the CPU and the RAM do not agree on width of the addressable units of memory. – Jamie Hanrahan Oct 11 '18 at 4:31
  • @Jamie Hanrahan: pretend I didn't use the word "agree"; the components need to be able to work together (I am, again, staying away from technical jargon, partly to be clear, partly because I don't know the jargon). To everyone else: If you find my answer useful, then it is essentially correct; if you think that it is not precisely technically correct, then you already knew enough not to need my help. – user184411 Dec 16 '18 at 19:48
  • ... and to further clarify: "The addresses that are sent to DIMMs" are not the end of the process of addressing. The CPU needs to continue the process within the larger chunk (64 bits, in this case) of data. And again, that's conceptually correct; my terms might not agree with the accepted jargon. And if you found my answer useful, you'll probably find this ongoing discussion confusing; you can safely ignore it. – user184411 Dec 16 '18 at 19:54
6

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.

|improve this answer|||||
  • My question is not about the bit of an address, but the amount of memory that an address is addressing. – Ben 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
1

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.

|improve this answer|||||
  • "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
  • 1
    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?" – Elliptical view Dec 26 '13 at 18:30
  • 1
    This doesn't directly answer the question, "[Which part does the thing?]" (paraphrased); but it does provide some good background info. Thanks! – jpaugh Oct 2 '18 at 16:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.