Difference between Big Endian and little Endian Byte order

前端 未结 6 414
情歌与酒
情歌与酒 2020-11-27 10:33

What is the difference between Big Endian and Little Endian Byte order ?

Both of these seem to be related to Unicode and UTF16. Where exactly do we use this?

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-27 10:58

    Big-endian and little-endian are terms that describe the order in which a sequence of bytes are stored in computer memory.

    1. Big-endian is an order in which the "big end" (most significant value in the sequence) is stored first (at the lowest storage address).
    2. Little-endian is an order in which the "little end" (least significant value in the sequence) is stored first.

    For example

    In a big-endian computer, the two bytes required for the hexadecimal number 4F52 would be stored as 4F52 in storage (if 4F is stored at storage address 1000, for example, 52 will be at address 1001).

    In a little-endian system, it would be stored as 524F (52 at address 1000, 4F at 1001).

提交回复
热议问题