Big-endian vs little-endian

Jonathan Swift’s Gulliver’s Travels is where the terms “big-endian” and “little-endian” first appear. In his story, people known as the “big-endians” broke their eggs in a primitive fashion: by smashing the bottom of the egg against an object. The rebellion happens against the “little-endian” faction which made it compulsory for their eggs to be broken from the top.

In the 90s, a large difference between Macs (which had Motorola processors) and PCs (which had intel processors), was the fact that Macs ran on big-endian, and PCs used little-endian.

While modern computers use little-endian, there are still file formats that are big-endian such as JPEG and PSD — so what is the meaning of these two terms in relation to computer science?

Big-endian means that the most significant bits in the sequence are stored first, whereas little-endian is the opposite. For instance, if a hex number 5E23 were to be stored, in big-endian, address 1000 would hold 5E, and 23 would be stored in place 1001. In little-endian, address 1000 would hold 23, and 5E would be stored in place 1001. (Bedell, C. 2021).

There are advantages for each. Big-endian is easier for English-speaking people to read, easier sign checking, and there is no endianness conversion when sending or receiving data from a network. The disadvantages are that if you read data with the wrong data size (8, 16, 32, 64-bit reads), you will end up with the wrong value.

The advantages of using little-endian are that parity checking is easier to do, math operations are simpler for a programmer to complete, and data is readable regardless of the read value. The disadvantage is that it is a lot slower since a computer has to keep reversing the byte order. This is why large graphical elements such as PSDs (Photoshop Documents) use big-endian rather.

(Dr. Verts, W. 1996).

Leave a Reply

Your email address will not be published. Required fields are marked *