Endianness

In computing, endianness is the order in which bytes within a word data type are transmitted over a data communication medium or addressed in computer memory, counting only byte significance compared to earliness. Endianness is primarily expressed as big-endian (BE) or little-endian (LE).

Computers store information in various-sized groups of binary bits. Each group is assigned a number, called its address, that the computer uses to access that data. On most modern computers, the smallest data group with an address is eight bits long and is called a byte. Larger groups comprise two or more bytes, for example, a 32-bit word contains four bytes.

There are two principal ways a computer could number the individual bytes in a larger group, starting at either end. A big-endian system stores the most significant byte of a word at the smallest memory address and the least significant byte at the largest. A little-endian system, in contrast, stores the least-significant byte at the smallest address.[1][2][3] Of the two, big-endian is thus closer to the way the digits of numbers are written left-to-right in English, comparing digits to bytes.

Both types of endianness are in widespread use in digital electronic engineering. The initial choice of endianness of a new design is often arbitrary, but later technology revisions and updates perpetuate the existing endianness to maintain backward compatibility. Big-endianness is the dominant ordering in networking protocols, such as in the Internet protocol suite, where it is referred to as network order, transmitting the most significant byte first. Conversely, little-endianness is the dominant ordering for processor architectures (x86, most ARM implementations, base RISC-V implementations) and their associated memory. File formats can use either ordering; some formats use a mixture of both or contain an indicator of which ordering is used throughout the file.[4]

Bi-endianness is a feature supported by numerous computer architectures that feature switchable endianness in data fetches and stores or for instruction fetches. Other orderings are generically called middle-endian or mixed-endian.[5][6][7][8]

  1. ^ "Understanding big and little endian byte order". betterexplained.com. Archived from the original on 2019-05-24. Retrieved 2019-05-20.
  2. ^ "Byte Ordering PPC". Archived from the original on 2019-05-09. Retrieved 2019-05-20.
  3. ^ "Writing endian-independent code in C". Archived from the original on 2019-06-10. Retrieved 2019-05-20.
  4. ^ A File Format for the Exchange of Images in the Internet. April 1992. p. 7. doi:10.17487/RFC1314. RFC 1314. Retrieved 2021-08-16.
  5. ^ "Internet Hall of Fame Pioneer". Internet Hall of Fame. The Internet Society. Archived from the original on 2021-07-21. Retrieved 2015-10-07.
  6. ^ Cary, David. "Endian FAQ". Archived from the original on 2017-11-09. Retrieved 2010-10-11.
  7. ^ James, David V. (June 1990). "Multiplexed buses: the endian wars continue". IEEE Micro. 10 (3): 9–21. doi:10.1109/40.56322. ISSN 0272-1732. S2CID 24291134.
  8. ^ Blanc, Bertrand; Maaraoui, Bob (December 2005). "Endianness or Where is Byte 0?" (PDF). Archived (PDF) from the original on 2007-12-03. Retrieved 2008-12-21.