When is memory a byte or an address and why

The memory can be address or byte (2 bytes, 4 bytes, etc.) addressable (please correct me if I am wrong here).

Is this (byte address or address) dependent on the processor architecture? If so, in what cases do we go for the address memory of bytes, and in what cases do we look for the address memory?

And what are the reasons for this? In other words, why the memory address can be addressed (in cases where this is the case) and why the word is addressed (if it occurs) and its reasons. I saw a few questions about the address memory of bytes on this site, but no one answered these questions.

+4
source share
1 answer

Obviously, different software must work with data / variables of different types and sizes, and it is often necessary to work with several different ones in the same code.

The ability to access these variables directly and generally, regardless of size, simplifies programming, since you do not need to glue, say, 4 8-bit bytes to form a 32-bit value or similarly extract a separate 8-bit value from a 32-bit memory cells.

There are processors that are not very flexible in terms of the size of the supported data. For example, fixed-point digital signal processors. Some can only access memory like 16-bit words and 32-bit double words. I think the lack of 8-bit byte addressing in them is not a big problem because they are expected to handle a lot of signal processing rather than being universal and suitable for general-purpose computing, and signal samples are rarely 8-bit (which too rude), most often they are 16-bit.

Supporting fewer data sizes and other hardware features makes this equipment simpler and cheaper (including in terms of energy consumption), which becomes important when we talk about thousands and millions of devices.

Different problems need different solutions, therefore diversity.

+4
source

Source: https://habr.com/ru/post/1403738/


All Articles