Endianness

From Wikipedia, the free encyclopedia
Jump to: navigation, search

Endianness refers to how hexadecimal data is ordered in machine language, the simplest, most understandable code that a computer can use.

In computer coding, certain numbers, usually two bytes long (1 byte = 8 bits) that are called "words", can be written or input in two ways: little-endian and big-endian. It depends on the data format and the way the computer reads the data.

Say that we have a "word" like this:

12AB ---> 12 | AB

Now, the way it's written right now is big-endian, because the bigger number is on the end. (In hexadecimal, the numbers go from 0 to 9, then from A to F. After F, a 1 is added to the front. [e.g. F+1=10, which is 16 in our numbering system])

To write it in little-endian, we simply switch the positions of the first two and the last two bits, so it becomes:

AB12 ---> AB | 12