Re: [問題] big-endian vs little-endian

作者: enonrick (EnonRick)   2018-04-19 14:26:58
※ 引述《zzss2003 (brotherD)》之銘言:
: 網址: https://stackoverflow.com/questions/13926760/the-reason-behind-endianness
: 網址裡面有提到big跟little的優缺點,但小弟資質不良,無法完全理解,想請各位前輩開
: 釋
: little-endian:
: 1. The little-endian system has the property that the same value can be read
: from memory at different lengths without using different addresses
value 4A in little-endian
char [4A]
short [4A 00]
int [4A 00 00 00]
long [4A 00 00 00 00 00 00 00]
可以節省記憶體
https://en.wikipedia.org/wiki/Endianness#Optimization
: 請問,at different lengths without using different addresses是什麼意思?
: 2. When adding or subtracting multi-byte numbers, the least significant byte
: must be fetched first to see if there is a carryover to more significant
: bytes. Because the least-significant byte is read first in little-endian
: numbers, the system can parallelize and begin calculation on this byte while
: fetching the following byte(s).
msb lsb
[010010101 10111010]
+[010001100 11100010]

Links booklink

Contact Us: admin [ a t ] ucptt.com