admin管理员组文章数量:1026989
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
1 Answer
Reset to default 0On 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 toDATA + 0
BB
goes toDATA + 1
CC
goes toDATA + 2
DD
goes toDATA + 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.
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
1 Answer
Reset to default 0On 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 toDATA + 0
BB
goes toDATA + 1
CC
goes toDATA + 2
DD
goes toDATA + 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.
本文标签:
版权声明:本文标题:storage - Characters storing in memory AABBCCDDEE..., Little Endian ?? I have no idea, how, can anyone answer please - Stack Ove 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1740922222a1797551.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论