Difference between revisions of "Little endian"
Line 27: | Line 27: | ||
== Uses == | == Uses == | ||
− | This [[endian]]ness is used (amongst others) in [http://www.intel.com x86], in [http://www.x86-64.org AMD64] and in | + | This [[endian]]ness is used (amongst others) in [http://www.intel.com x86], in [http://www.x86-64.org AMD64] and in [http://h18002.www1.hp.com/alphaserver/vax VAX] machines. |
== Notes == | == Notes == | ||
To understand better the little [[endian]] concept it is helpful to compare it to the [[big endian]] concept. | To understand better the little [[endian]] concept it is helpful to compare it to the [[big endian]] concept. |
Revision as of 02:16, 10 March 2005
Introduction to endianness
Having read the endianness article, you might already have an idea of what this is for.
The endianess defines the bytes' order in physical memory.
Definition
When you must store a two-bytes (or larger) value in memory, you can either store the first byte(s) in the first place or the second byte(s) in the first place.
Little endian defines that the first bytes will go first.
Example
An example of a two-bytes number is 65534. This number requires two bytes to be stored in memory. The decimal number 65534 is represented, in hexadecimal, as FFFE (or 0xFFFE). Here we can see the two byes: FF and FE.
We can decide wether we want to place the FF byte first in memory or the FE byte first.
Little endian tells us to place first the which whose numbers have less weight in the total number. That is FF, since FE here represents 254, while FF represents 65280.
So, physically in memory we would have:
_________________________ Memory Graph: |_____FE_____|_____FF_____| Memory Possitions: 000001 000002
Uses
This endianness is used (amongst others) in x86, in AMD64 and in VAX machines.
Notes
To understand better the little endian concept it is helpful to compare it to the big endian concept.