最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

storage - Characters storing in memory AABBCCDDEE..., Little Endian ?? I have no idea, how, can anyone answer please - Stack Ove

programmeradmin13浏览0评论

I got asked this question in my Computer Organization and Architecture assesment. Can you guys please help me with this?

"A processor is designed to receive a data stream in little endian format and store it at address starting DATA in word order. If the received data is AABBCCDDEE...., show the layout of storage in memory."

I didn't get proper answer for this question, i thought the size of the bit of the computer matters(whether it is 32 or 64 bits). If yes, assume it is 32 bit computer. I am not sure of the answer. I think the answer for this is to write the character in reverse can someone please explain how and why?

I got asked this question in my Computer Organization and Architecture assesment. Can you guys please help me with this?

"A processor is designed to receive a data stream in little endian format and store it at address starting DATA in word order. If the received data is AABBCCDDEE...., show the layout of storage in memory."

I didn't get proper answer for this question, i thought the size of the bit of the computer matters(whether it is 32 or 64 bits). If yes, assume it is 32 bit computer. I am not sure of the answer. I think the answer for this is to write the character in reverse can someone please explain how and why?

Share Improve this question asked yesterday Mohan Vishnu KumarMohan Vishnu Kumar 32 bronze badges New contributor Mohan Vishnu Kumar is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct. 1
  • This question seems fairly ill-defined, Intel and others call a word 16 bits whereas some specify it as the native data size. Also it mentions it's received in little endian but no indication of the endianess of the processor. – PeterJ Commented yesterday
Add a comment  | 

1 Answer 1

Reset to default 0

On a little-endian system, the least significant byte goes to the lowest memory address. If you receive a byte stream in little-endian order (e.g., AA BB CC DD EE ...) and store it word by word in a 32-bit processor, you group the bytes in chunks of four. For each 4-byte group (word), the first byte is the least significant byte, so it ends up at the smallest address within that word.

Concretely, for the first word AA BB CC DD:

  • AA goes to DATA + 0
  • BB goes to DATA + 1
  • CC goes to DATA + 2
  • DD goes to DATA + 3

So, in the actual byte-by-byte memory dump (from lowest to highest address), you’ll see AA BB CC DD EE FF GG HH ... exactly in the order the bytes arrive. But if you interpret AA BB CC DD as a 32-bit value in little-endian format, it corresponds to the integer 0xDDCCBBAA in typical hex notation (because the “DD” byte is the most significant part of that integer, even though it’s in the highest memory address of the word). That “reverse” effect often confuses people, but it’s really just how little-endian works at the per-word level.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论