simply put
Big endian conforms to human habits
MSB LSB
In microcontrollers, we often see descriptions such as MSB first and LSB first.
Most Significant Bit, Last (Least) Significant Bit
High Significant Bit Low Significant Bit
For a1
, the 1 placed in the hundreds place is larger and more 'valuable' than the 1 placed in the tens place, so we say it can represent greater The bits of data are 高有效位
, and the smaller bits representing data are called 低有效位
. For example, the number 5 is 0101b in binary; then
big endian little endian
big endian meanslower address stores the most significant byte (MSB),
little endian means YesThe low address stores the least significant byte (LSB).
Example 1, illustrated with figures using the number 0xB4 (10110100)
Example 2 illustrates with int a =5;
a is an int type data, occupying 4 bytes. Its address is 0x600 0001, but it is 大端
, so it is stored at a low address (0x600 0001 relative to 0x600 0004) MSB (highly significant bit), so big endian