Misplaced Pages

Endianness: Difference between revisions

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Browse history interactively← Previous editNext edit →Content deleted Content addedVisualWikitext
Revision as of 20:54, 15 October 2002 editMjb (talk | contribs)Extended confirmed users10,692 editsm link fix← Previous edit Revision as of 21:22, 9 March 2003 edit undo62.253.132.234 (talk) make "serial" point to new "serial communications" pageNext edit →
Line 16: Line 16:
The ] defines a standard "big-endian" '''network byte order''', where binary values are in general encoded into packets, and sent out over the network, most significant byte first. This occurs regardless of the native endianness of the host CPU. The ] defines a standard "big-endian" '''network byte order''', where binary values are in general encoded into packets, and sent out over the network, most significant byte first. This occurs regardless of the native endianness of the host CPU.


] devices also have bit-endianness: the bits in a byte can be sent little-endian (least significant bit first) or big-endian (most significant bit first). ] devices also have bit-endianness: the bits in a byte can be sent little-endian (least significant bit first) or big-endian (most significant bit first).
This decision is made in the very bottom of the ] of the ]. This decision is made in the very bottom of the ] of the ].



Revision as of 21:22, 9 March 2003

Endianness refers to a computer architecture's ordering of parts of a unit in memory.

When some computers store a 32-bit integer value in memory, for example 0xDEADBEEF, they store it as bytes in the following order: DE AD BE EF, that is, most significant byte first (that is to say, most significant byte is stored at the lowest byte address in store within this word).

Architectures that follow this rule are called big-endian and include Motorola 68000 and PowerPC.

Other computers store 0xDEADBEEF as EF BE AD DE, that is, least significant byte first. Architectures that follow this rule are called little-endian and include MOS Technologies 6502 and Intel x86.

Some architectures can be configured either way; these include ARM and MIPS.

Still other (generally older) architectures, called middle-endian, may have a more complicated ordering such that the bytes within a 16-bit unit are ordered differently from the 16-bit units within a 32-bit word. For instance, old Cray supercomputers stored the integer BE EF DE AD. See also NUXI problem.

The Internet Protocol defines a standard "big-endian" network byte order, where binary values are in general encoded into packets, and sent out over the network, most significant byte first. This occurs regardless of the native endianness of the host CPU.

Serial devices also have bit-endianness: the bits in a byte can be sent little-endian (least significant bit first) or big-endian (most significant bit first). This decision is made in the very bottom of the data link layer of the OSI model.

The terms "big-endian" and "little-endian" relate to the conflict over which end to crack an egg in the voyage to Lilliput and Blefuscu from Gulliver's Travels by "Dr. Lemuel Gulliver" (pen name of Jonathan Swift).

Additional Resources