1
$\begingroup$

Well, my question - if word addressable memory has more bytes than byte addressable memory - is derived from the fact that in word addressable memory each address addresses a word and in byte addressable memory each address addresses a byte. In the case of word addressable memory - If the word size is 4 bytes 32 bit architecture, for example, do i have 4*2^32 bytes in my memory? And in the case of byte addressable memory -will i have 2^32 bytes in my memory?

How is it possible that the same ram, i.e given the ram size is 4 GB, would contain different number of bytes depending on byte/ word addressable memory?

1GB RAM has 1*1024*1024*1024 bytes in it. Say our architecture is 32 bit. So in the case of byte addressable memory there will be 4*1024*1024*1024 virtual addresses per program but in reality there are 1*1024*1024*1024 physical addresses, each points to a byte. In the case of word addressable memory there will be 4*1024*1024*1024 virtual addresses per program - each address points to a word? So in this case there will be theoretically 4*4*1024*1024*1024 bytes available for each program ? There will be 1*1024*1024*1024 physical addresses, each address points to a word. So there are actually 4*1*1024*1024*1024 bytes in the memory in this case?

As you can see I am super confused.

$\endgroup$
2
$\begingroup$

If you had a byte addressable architecture where pointers have a fixed size, and every or almost every bit pattern is a valid pointer to a distinct byte address, and a word addressable architecture where pointers have the same fixed size, and every or almost every bit pattern is a valid pointer to a distinct word address, then the second architecture could address more memory. Which means you could buy more RAM for more money and put it into a computer and use it.

That second architecture would be in big trouble with lots of data structures that require byte pointers, like typical implementations of strings, compressed data, etc. Writing an mp3 player with word addressable memory wouldn't be my kind of fun.

In practice, even mobile phones are using 64 bit processors with pointers taking up 64 bits of memory, and the addressable amount of memory right now so much exceeds what anyone could reasonably pay, that it just doesn't matter. 4 GB of memory cost around 20 dollars, multiply by 4 billion, that's 80 billion dollars, and that's what you can address with byte addressability and 64 bit pointers.

(An analogy: You have an order form that allows you to order boxes of eggs. There are only six digits space, so you can order at most 999,999 boxes. If you order boxes of 18 eggs instead of boxes of 6 eggs, you can order three times as many eggs. You also pay three times as much money. Now you look at your form and it has space for 20 digits. That's more than the whole worlds egg production, whether you order them in boxes of 6 or 18. )

$\endgroup$
1
$\begingroup$

It really depends on how you define word adressable :

  • Before the triumph of the 8bits byte, there were all sorts of architectures with different grain sizes.

  • Some DSPs have no direct byte accesses (for example Analog Devices SHARC : 32 for integers, 40 for floats and 48 bits for intructions).

  • Some CPUs have no byte access instructions, but still use byte addresses. For example early DEC Alphas.

  • Due to EDC constraints (error detection and correction), it may be impossible to change a single byte, so write byte accesses are effectively 32, 64 or 128 bits reads, mask, insert the byte, then write back 32, 64 or 128 bits.

Just like changing sector or cluster sizes can change the theorical maximum capacity of hard disks on some OSes, addressing memory by 32bits words instead of 8bits bytes effectively allows to multiply by 4 the amount of addressable data.

$\endgroup$
  • $\begingroup$ I do not follow "8bit bytes" - the second is addressing mode? Are you sure it is four times more? $\endgroup$ – Evil Jul 27 '16 at 22:13
  • $\begingroup$ I still do not understand how addressing memory by 32bits words instead of 8bits bytes allows to multiply by 4 the amount of addressable data. the physical memory capacity is always the same. 4GB RAM will always remain 4GB -so how is that possible that word addressable memory can contain more data (IF THE SAME PHYSICAL MEMORY IS BEING USED)? $\endgroup$ – Liron Cohen Jul 28 '16 at 6:54
  • $\begingroup$ That i understood. $\endgroup$ – Liron Cohen Jul 28 '16 at 7:21
  • $\begingroup$ My confusion is mainly because of the byte addressable vs word addressable part $\endgroup$ – Liron Cohen Jul 28 '16 at 7:22
  • $\begingroup$ Of course you need to buy four times as much RAM if your RAM is 32 bit addressable. $\endgroup$ – gnasher729 Jul 28 '16 at 13:23
1
$\begingroup$

How is it possible that tha same ram, i.e given the ram size is 4 GB, would contain different number of bytes depending on byte/ word addressable memory?

It isn't. a 4GB amount of ram would either contain $2^{31.9}$ byte-addressable memory locations, or $2^{29.9}$ 32-bit-word addressable memory locations. 4GB is 4GB, regardless of what unit you divide it into.

$\endgroup$
  • $\begingroup$ So if i got this strait - word addressable memory simply consists of less physical addresses than byte addressable memory. Both will have the same amount of virtual address (depending on their architecture- 32 bit, 64 bit etc.) So theoretically with word addressable memory you could access more bytes, but in real life you cant because of the physical limit of the ram $\endgroup$ – Liron Cohen Jul 28 '16 at 7:42
  • $\begingroup$ Am I being right? $\endgroup$ – Liron Cohen Jul 28 '16 at 7:53

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.