FACTOID # 185: Russia produces more natural gas than the next six countries combined, and has over a quarter of the world's proven gas reserves.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
WHAT'S NEW
RELATED ARTICLES
People who viewed "Endianness" also viewed:
RECENT ARTICLES
More Recent Articles »
 

Encyclopedia > Endianness

In computing, endianness is the byte (and sometimes bit) ordering in memory used to represent some kind of data. Typical cases are the order in which integer values are stored as bytes in computer memory (relative to a given memory addressing scheme) and the transmission order over a network or other medium. When specifically talking about bytes, endianness is also referred to simply as byte order. [1] For the formal concept of computation, see computation. ... For the computer industry magazine, see Byte (magazine). ... This article is about the unit of information. ... For the computer industry magazine, see Byte (magazine). ... In computing, an address space defines a range of discrete addresses, each of which may correspond to a physical or virtual memory register, a network host, peripheral device, disk sector or other logical or physical entity. ...


Generally speaking, endianness is a particular attribute of a representation format - which byte of a UCS-2 character would be stored at the lower address, etc. Byte order is an important consideration in network programming, since two computers with different byte orders may be communicating. Failure to account for varying endianness is notorious among computer programmers as a source of bugs.[citation needed] In computing, UCS-2 and UTF-16 are alternative names for a 16-bit Unicode Transformation Format, a character encoding form that provides a way to represent a series of abstract characters from Unicode and ISO/IEC 10646 as a series of 16-bit words suitable for storage or transmission... In computing, a programmer is someone who does computer programming and develops computer software. ... A software bug is an error, flaw, mistake, failure, or fault in a computer program that prevents it from behaving as intended (e. ...

Contents

Clarifying analogy

Endianness is the system used to arrange things by order of magnitude. To illustrate this, by analogy, numbers are written in a big-endian order, with the highest order numbers coming first. For example, the number 234 signifies 2 hundreds (102), 3 tens (101) and 4 'single numbers' (100). Dates ordered that way would be written yyyy-mm-dd. The dd-mm-yyyy system would then be little endian and mm-dd-yyyy middle endian because the middle order of magnitude is written first. An order of magnitude is the class of scale or magnitude of any amount, where each class contains values of a fixed ratio to the class preceding it. ...


Endianness and hardware

Most modern computer processors agree on bit ordering "inside" individual bytes (this was not always the case). This means that any single-byte value will be read the same on almost any computer one may send it to. CPU redirects here. ...


Integers are usually stored as sequences of bytes, so that the encoded value can be obtained by simple concatenation. The two most common of them are:

  • increasing numeric significance with increasing memory addresses, known as little-endian, and
  • its opposite, most-significant byte first, called big-endian.[2]

Again, big-endian does not mean "ending big", but "big end first".


Intel's x86 processors use the little-endian format (sometimes called the Intel format), as does the venerable 6502 family. Motorola processors have generally used big-endian. PowerPC (which includes Apple's Macintosh line prior to the Intel switch) and System/370 also adopt big-endian. SPARC historically used big-endian, though version 9 is bi-endian (see below). Intel Corporation (NASDAQ: INTC, SEHK: 4335), founded in 1968 as Integrated Electronics Corporation, is an American multinational corporation that is best known for designing and manufacturing microprocessors and specialized integrated circuits. ... x86 or 80x86 is the generic name of a microprocessor architecture first developed and manufactured by Intel. ... The MOS Technology 6502 is an 8-bit microprocessor designed by MOS Technology in 1975. ... Motorola Inc. ... PowerPC is a RISC microprocessor architecture created by the 1991 Apple–IBM–Motorola alliance, known as AIM. Originally intended for personal computers, PowerPC CPUs have since become popular embedded and high-performance processors as well. ... The Apple Intel transition was the process of changing the CPU of Macintosh computers from PowerPC processors to Intel x86 processors. ... IBM logo The IBM System/370 (often: S/370) was a model range of IBM mainframes announced on June 30, 1970 as the successors to the System/360 family. ... Sun UltraSPARC II Microprocessor Sun UltraSPARC T1 (Niagara 8 Core) SPARC (Scalable Processor Architecture) is a RISC microprocessor instruction set architecture originally designed in 1985 by Sun Microsystems. ...


Bi-endian hardware

Some architectures (including ARM, PowerPC (but not the PPC970/G5), DEC Alpha, SPARC V9, MIPS, PA-RISC and IA64) feature switchable endianness. This feature can improve performance or simplify the logic of networking devices and software. The word bi-endian, said of hardware, denotes the capability to compute or pass data in either of two different endian formats. The ARM architecture (previously, the Advanced RISC Machine, and prior to that Acorn RISC Machine) is a 32-bit RISC processor architecture developed by ARM Limited that is widely used in a number of embedded designs. ... PowerPC is a RISC microprocessor architecture created by the 1991 Apple–IBM–Motorola alliance, known as AIM. Originally intended for personal computers, PowerPC CPUs have since become popular embedded and high-performance processors as well. ... PowerPC 970FX Processor In computing, the PowerPC 970, PowerPC 970FX, PowerPC 970GX, and PowerPC 970MP, are 64-bit processors in the PowerPC family from IBM. The PowerPC 970 was introduced in 2002. ... DEC Alpha AXP 21064 Microprocessor die photo Package for DEC Alpha AXP 21064 Microprocessor Alpha AXP 21064 bare die mounted on a business card with some statistics The DEC Alpha, also known as the Alpha AXP, is a 64-bit RISC microprocessor originally developed and fabricated by Digital Equipment Corp... Sun UltraSPARC II Microprocessor Sun UltraSPARC T1 (Niagara 8 Core) SPARC (Scalable Processor Architecture) is a RISC microprocessor instruction set architecture originally designed in 1985 by Sun Microsystems. ... A MIPS R4400 microprocessor made by Toshiba. ... PA-RISC is a microprocessor architecture developed by Hewlett-Packards Systems & VLSI Technology Operation. ... In computing, IA-64 (Instruction Architecture-64) is a 64-bit processor architecture developed in cooperation by Intel and Hewlett-Packard for processors such as Itanium and Itanium 2. ...


Many of these architectures can be switched via software to default to a specific endian format (usually done when the computer starts up); however, on some systems the default endianness is selected by hardware on the motherboard and cannot be changed via software (e.g., the DEC Alpha, which runs only in big-endian mode on the Cray T3E). The Cray T3E was a massively parallel supercomputer sold by Cray Research from 1995. ...


Note that "bi-endian" refers primarily to how a processor treats data accesses. Instruction accesses (fetches of instruction words) on a given processor may still assume a fixed endianness, even if data accesses are fully bi-endian.


Note, too, that some nominally bi-endian CPUs may actually employ internal "magic" (as opposed to really switching to a different endianness) in one of their operating modes. For instance, some PowerPC processors in little-endian mode act as little-endian from the point of view of the executing programs but they do not actually store data in memory in little-endian format (multi-byte values are swapped during memory load/store operations). This can cause problems when memory is transferred to an external device if some part of the software, e.g. a device driver, does not account for the situation. In the context of computer programming, magic is used to describe code that handles complex tasks while hiding that complexity to present a simple interface. ... PowerPC is a RISC microprocessor architecture created by the 1991 Apple–IBM–Motorola alliance, known as AIM. Originally intended for personal computers, PowerPC CPUs have since become popular embedded and high-performance processors as well. ...


Floating-point and endianness

On some machines, while integers were represented in little-endian form, floating-point numbers were represented in big-endian form. [3] Because there are many floating formats, and a lack of a standard "network" representation, no standard for transferring floating point values has been made. This means that floating point data written on one machine may not be readable on another, and this is the case even if both use IEEE 754 floating point arithmetic since the endian-ness of the memory representation is not part of the IEEE specification. [4] The IEEE Standard for Binary Floating-Point Arithmetic (IEEE 754) is the most widely-used standard for floating-point computation, and is followed by many CPU and FPU implementations. ...


Discussion, background, etymology

The choice of big-endian vs. little-endian has been the subject of flame wars. The very term big-endian comes from Jonathan Swift's satirical novel Gulliver’s Travels, where tensions are described in Lilliput and Blefuscu: whereas royal edict in Lilliput requires cracking open one's soft-boiled egg at the small end, inhabitants of the rival kingdom of Blefuscu crack theirs at the big end (giving them the moniker Big-endians).[3] The terms little-endian and endianness have a similar ironic intent.[4] This article is about the Internet meaning of the word flaming. For other meanings, and meanings of the word flame, see Flame. ... Jonathan Swift Jonathan Swift (November 30, 1667 – October 19, 1745) was an Irish cleric, satirist, essayist, political pamphleteer (first for Whigs then for Tories), and poet, famous for works like Gullivers Travels, A Modest Proposal, A Journal to Stella, The Drapiers Letters, The Battle of the Books, and... First Edition of Gullivers Travels Gullivers Travels (1726, amended 1735), officially Travels into Several Remote Nations of the World, in Four Parts. ... Lilliput and Blefuscu are two island nations that appear in the 1726 novel Gullivers Travels by Jonathan Swift. ...


An often cited argument in favor of big-endian is that it is consistent with the ordering used in natural languages; that is, however, far from being universal, both in spoken and written form: A linguistic universal is a statement that is true for all natural languages. ...

  • spoken: though most spoken languages express most numbers, especially those larger than a hundred, in a "big-endian manner"[5] (in modern English, for example, one says "twenty-four", not "four-and-twenty") there are notable exceptions such as the German, Danish, Dutch, and Slovenian languages, which use "little-endian" for numbers up to 99 and "mixed endianness" for larger numbers (e.g. vierundzwanzig / fireogtyve / vierentwintig (24, literally "four-and-twenty"), and hundertvierundzwanzig (124, literally "hundred four-and-twenty"). The Sanskrit language is another exception which uses "little-endian" for small (e.g. chaturvinsh (24, literally "four-and-twenty")) as well as large numbers (e.g. chaturvinshatyadhikashatatam (124, literally "four-and-twenty-over-hundred")).
  • written: the Hindu-Arabic numeral system is used worldwide and is such that the most significant digits are always written to the left of the less significant ones. Writing left to right, this system is therefore "big-endian" (big end first). Writing right to left, this numeral system is "little-endian". It is worth noting, also, that in quite a few languages the spoken order of numerals is inconsistent with how they appear written; and that in some languages, such as Persian and Hebrew, it is common to interrupt the writing of text (right-to-left) to write a number in the opposite order (left-to-right)

The little-endian system has the property that, in the absence of alignment restrictions, values can be read from memory at different widths without using different addresses. For example, a 32-bit memory location with content 4A 00 00 00 can be read at the same address as either 8-bit (value = 4A), 16-bit (004A), or 32-bit (0000004A). (This example works only if the value makes sense in all three sizes, which means the value fits in just 8 bits.) This little-endian property is rarely used, and doesn't imply that little-endian has any performance advantage in variable-width data access. (In real-world analogy, though, if one had 1004 widgets, this could be said to be like knowing that one has “something-ending-in-4” widgets before knowing that one has one thousand of them.) See also Sing a Song of Sixpence, a Sesame Beginnings book. ... Sanskrit ( , for short ) is a classical language of India, a liturgical language of Hinduism, Buddhism, Sikhism, and Jainism, and one of the 23 official languages of India. ... I like cream cheese, it tastes good on toast. ... The introduction to this article provides insufficient context for those unfamiliar with the subject matter. ...


Conversely, in big-endian systems, the first byte is simply the coarsest part of the value, and subsequent bytes increase in precision. (In real-world analogy, if one had 1004 widgets, this is like finding that one has one thousand widgets before finding that the exact number is 1004.)


Method of mapping registers to memory locations

Mapping registers to memory locations
Mapping registers to memory locations

Using this chart, one can map an access (or, for a concrete example: "write 32 bits to address 0") from register to memory or from memory to register. To help in understanding that access, little and big endianness can be seen in the diagram as differing in their coordinate system's orientation. Big endianness's atomic units and memory coordinate system increases in the diagram from left to right, while little endianness's units increase from right to left. A example of how to apply the diagram is shown in the descriptive text of the image here: Image:Endianessmap.jpg. Image File history File links Endianessmap. ... Image File history File links Endianessmap. ... Image File history File links No higher resolution available. ...


Examples of storing the value 0x0A0B0C0D in memory

Note: the prefix 0x indicates hexadecimal notation.

To further illustrate the above notions this section provides example layouts of a 32-bit number in the most common variants of endianness. There is no general guarantee that a platform will use one of these formats but in practice there are few if any exceptions. In mathematics and computer science, hexadecimal, base-16, or simply hex, is a numeral system with a radix, or base, of 16, usually written using the symbols 0–9 and A–F, or a–f. ...


All the examples refer to the storage in memory of the value 0x0A0B0C0D.


Big Endian

  • With 8-bit atomic element size and 1-byte (octet) address increment:
increasing addresses  →
... 0x0A 0x0B 0x0C 0x0D ...

The most significant byte (MSB) value, which is 0x0A in our example, is stored at the memory location with the lowest address, the next byte value in significance, 0x0B, is stored at the following memory location and so on. This is akin to Left-to-Right reading order in hexadecimal. Image File history File links Big-Endian. ... In computing, the most significant bit (MSB) is the bit position in a binary number having the greatest value. ...

  • With 16-bit atomic element size:
increasing addresses  →
... 0x0A0B 0x0C0D ...

The most significant atomic element stores now the value 0x0A0B, followed by 0x0C0D.


Little Endian

  • With 8-bit atomic element size and 1-byte (octet) address increment:
increasing addresses  →
... 0x0D 0x0C 0x0B 0x0A ...

The least significant byte (LSB) value, 0x0D, is at the lowest address. The other bytes follow in increasing order of significance. Image File history File links Little-Endian. ... In computing, the least significant bit (LSB) is the bit position in a binary number having the value of 1. ...

  • With 16-bit atomic element size:
increasing addresses  →
... 0x0C0D 0x0A0B ...

The least significant 16-bit unit stores the value 0x0C0D, immediately followed by 0x0A0B.

  • With byte addresses increasing from right to left:

The 16-bit atomic element byte ordering may look backwards as written above, but this is because little-endian is best written with addressing increasing towards the left. If we write the bytes this way then the ordering makes slightly more sense:

←  increasing addresses
... 0x0A 0x0B 0x0C 0x0D ...

The least significant byte (LSB) value, 0x0D, is at the lowest address. The other bytes follow in increasing order of significance. In computing, the least significant bit (LSB) is the bit position in a binary number having the value of 1. ...

←  increasing addresses
... 0x0A0B 0x0C0D ...

The least significant 16-bit unit stores the value 0x0C0D, immediately followed by 0x0A0B.


However, if one displays memory with addresses increasing to the left like this, then the display of Unicode (or ASCII) text is reversed from the normal display (for left-to-right languages). For example, the word "XRAY" displayed in the "little-endian-friendly" manner just described is: The Unicode Standard, Version 5. ... Image:ASCII fullsvg There are 95 printable ASCII characters, numbered 32 to 126. ...

←  increasing addresses
... "Y" "A" "R" "X" ...

This conflict between the memory arrangements of binary data and text is intrinsic to the nature of the little-endian convention, but is a conflict only for languages written left-to-right (such as the western European languages like English). For right-to-left languages such as Arabic, there is no conflict of text with binary, and the preferred display in both cases would be with addresses increasing to the left. (On the other hand, right-to-left languages have a complementary intrinsic conflict in the big-endian system.) Arabic can mean: From or related to Arabia From or related to the Arabs The Arabic language; see also Arabic grammar The Arabic alphabet, used for expressing the languages of Arabic, Persian, Malay ( Jawi), Kurdish, Panjabi, Pashto, Sindhi and Urdu, among others. ...


Middle Endian

Still other architectures, generically called middle-endian or mixed-endian, may have a more complicated ordering; PDP-11, for instance, stored some 32-bit words, counting from the most significant, as: 2nd byte first, then 1st, then 4th, and finally 3rd. The PDP-11 was a 16-bit minicomputer sold by Digital Equipment Corp. ...

  • storage of a 32-bit word on a PDP-11
increasing addresses  →
... 0x0B 0x0A 0x0D 0x0C ...

Note that this can be interpreted as storing the most significant "half" (16-bits) followed by the less significant half (as if big-endian) but with each half stored in little-endian format. This ordering is known as PDP-endianness.


The ARM architecture can also produce this format when writing a 32-bit word to an address 2 bytes from a 32-bit word alignment. The ARM architecture (previously, the Advanced RISC Machine, and prior to that Acorn RISC Machine) is a 32-bit RISC processor architecture developed by ARM Limited that is widely used in a number of embedded designs. ... The introduction to this article provides insufficient context for those unfamiliar with the subject matter. ...


Endianness in networking

Networks generally use big-endian order, and thus it is called network order when sending information over a network in a common format. The historical reason is that this allowed routing while a telephone number was being composed. In fact, the Internet Protocol defines a standard big-endian network byte order. This byte order is used for all numeric values in the packet headers and by many higher level protocols and file formats that are designed for use over IP. The Berkeley sockets API defines a set of functions to convert 16- and 32-bit integers to and from network byte order: the htonl (host-to-network-long) and htons (host-to-network-short) functions convert 32-bit and 16-bit values respectively from machine (host) to network order; whereas the ntohl and ntohs functions convert from network to host order. This article is about routing (or routeing) in computer networks. ... A telephone number is a sequence of decimal digits that uniquely indicates the network termination point. ... The Internet Protocol (IP) is a data-oriented protocol used for communicating data across a packet-switched internetwork. ... The Berkeley sockets application programming interface (API) comprises a library for developing applications in the C programming language that perform inter-process communication, most commonly across a computer network. ... API and Api redirect here. ...


While the lowest network protocols may deal with sub-byte formatting, all the layers above them usually consider the byte (mostly meant as octet) as their atomic unit. In computing, an octet is a grouping of eight bits. ...


"Bit endianness"

The terms bit endianness or bit-level endianness are seldom used when talking about the representation of a stored value, as they are only meaningful for the rare computer architectures which support addressing of individual bits. They are used however to refer to the transmission order of bits over a serial medium. Most often that order is transparently managed by the hardware and is the bit-level analogue of little-endian (low-bit first), although protocols exist which require the opposite ordering (e.g. I²C). In networking, the decision about the order of transmission of bits is made in the very bottom of the data link layer of the OSI model. I²C is a multi-master serial computer bus invented by Philips that is used to attach low-speed peripherals to a motherboard, embedded system, or cellphone. ... This article does not cite any references or sources. ... The Open Systems Interconnection Basic Reference Model (OSI Reference Model or OSI Model for short) is a layered, abstract description for communications and computer network protocol design, developed as part of the Open Systems Interconnection (OSI) initiative. ...


Other meanings

Some authors extend the usage of the word "endianness", and of related terms, to entities such as street addresses, date formats and others. It should be noticed however that such usages—basically reducing endianness to a mere synonym of ordering of the parts—are non-standard usage (e.g., ISO 8601:2004 talks about "descending order year-month-day", not about "big-endian format"), do not have widespread usage, and are generally (other than for date formats) employed in a metaphorical sense. An address is a code and abstract concept expressing the fixed location of a home, business or other building on the earths surface. ... A date in a calendar is a reference to a particular day represented within a calendar system. ... ISO 8601 is an international standard for date and time representations issued by the International Organization for Standardization (ISO). ...


"Endianness" is sometimes used to describe the order of the components of an internet site address, e.g. 'en.wikipedia.org' (the usual modern form) versus the reverse-DNS 'org.wikipedia.en' (often used in old times and still used for Java packages). In the context of the Internet Protocol and the Domain Name System, a reverse lookup is often referred to simply as reverse resolving, or more specifically reverse DNS lookups. ...


Notes

  1. ^ For hardware, the Jargon File also reports the less common expression byte sex [1]. It is unclear whether this terminology is also used when more than two orderings are possible. Similarly, the manual for the ORCA/M assembler refers to a field indicating the order of the bytes in a number field as NUMSEX, and the Mac OS X operating system refers to "byte sex" in its compiler tools [2].
  2. ^ Note that, in these expressions, the term "end" is meant as "extremity", not as "last part"; and that big and little say which extremity is written first.
  3. ^ Gulliver's Travels (Part I, Chapter IV) on Wikisource
  4. ^ Endian FAQ – includes the paper Internet Engineering Note (IEN) 137: On Holy Wars and a Plea for Peace ftp mirror by Danny Cohen (1 April 1980), but adds much more context.
  5. ^ Cf. entries 539 and 704 of the Linguistic Universals Database

The Jargon File is a glossary of hacker slang. ... See the terminology section, below, regarding inconsistent use of the terms assembly and assembler. ... Mac OS X (pronounced ) is a line of graphical operating systems developed, marketed, and sold by Apple Inc. ... The original Wikisource logo. ...

External links

This article was originally based on material from the Free On-line Dictionary of Computing, which is licensed under the GFDL. This article does not cite any references or sources. ... “GFDL” redirects here. ...


  Results from FactBites:
 
Introduction to Endianness - big endian, little endian, byte order, byte swap (1120 words)
Endianness is the attribute of a system that indicates whether integers are represented from left to right or right to left.
Little endian means that the least significant byte of any multibyte data field is stored at the lowest memory address, which is also the address of the larger field.
For that reason, it may be unwise to select a little endian processor for use in a device, such as a router or gateway, with an abundance of network functionality.
  More results at FactBites »

 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your location
Your comments
Please enter the 5-letter protection code


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms.