网址: 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
请问,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).
这一段我看得懂,大致上的意思是little-endian有办法一边fetch lower byte 一边做计
算,如果是big-endian就必须全部fetch下来才可以做计算
big-endian:
1. it is simple to tell whether a number is positive or negative by simply
examining the bit at offset 0 in the lowest order byte.
这边我也看得懂,big-endian的优点就是很容易比出两个数字的大小。
2. binary digits are ordered as most people order base-10 digits. This is
advantageous performance-wise when converting from binary to decimal.
不懂,为什么从2进制转换成10进制会有performance-wise?
我认为不管是big还是little,转成10进制的效能都是一样的,只是big从MSB开始加,
little从LSB开始加
请各位指点迷津,谢谢