We are independent & ad-supported. We may earn a commission for purchases made through our links.
Advertiser Disclosure
Our website is an independent, advertising-supported platform. We provide our content free of charge to our readers, and to keep it that way, we rely on revenue generated through advertisements and affiliate partnerships. This means that when you click on certain links on our site and make a purchase, we may earn a commission. Learn more.
How We Make Money
We sustain our operations through affiliate commissions and advertising. If you click on an affiliate link and make a purchase, we may receive a commission from the merchant at no additional cost to you. We also display advertisements on our website, which help generate revenue to support our work and keep our content free for readers. Our editorial team operates independently of our advertising and affiliate partnerships to ensure that our content remains unbiased and focused on providing you with the best information and recommendations based on thorough research and honest evaluations. To remain transparent, we’ve provided a list of our current affiliate partners here.
Hardware

Our Promise to you

Founded in 2002, our company has been a trusted resource for readers seeking informative and engaging content. Our dedication to quality remains unwavering—and will never change. We follow a strict editorial policy, ensuring that our content is authored by highly qualified professionals and edited by subject matter experts. This guarantees that everything we publish is objective, accurate, and trustworthy.

Over the years, we've refined our approach to cover a wide range of topics, providing readers with reliable and practical advice to enhance their knowledge and skills. That's why millions of readers turn to us each year. Join us in celebrating the joy of learning, guided by standards you can trust.

What is Endianness?

By Rachel Burkot
Updated: May 16, 2024
Views: 9,900
Share

Endianness is the function of a system that details integer representation. It orders the way the numbers appear. Much like a spoken language, integers as part of codes must be translated onto paper. While some cultures read right to left and some read left to right, numbers in codes can also be arranged either from right to left or left to right.

A system’s memory contains bytes, and each location in the system stores one element of the memory. These elements are usually bytes, although some systems store bits. One word or integer translates to 32 bits, or four bytes. Since each memory address can only store one byte, not four, the integer must split into individual bytes, which each use two digits to represent that byte’s value.

The term endianness comes from the book Gulliver’s Travels by Jonathan Swift, where he satirically describes the differences between the way people eat boiled eggs—either from the big end or the little end. Hence, endianness comes in two varieties: big endian and little endian. A big endian arrangement takes an integer consisting of multiple bytes and places the most significant of these bytes on the left. The most significant byte is stored in the smallest address. This type of byte ordering is easy to comprehend by those who speak languages such as English, where text is read from left to right.

A little endian arrangement is one in which the most important byte in a multibyte integer will be on the right. Here, the least significant byte is stored in the smallest address. This makes for a right to left reading, like the Hebrew and Arabic languages. To keep byte ordering straight, remember that when the least significant byte (LSB) is stored first, it’s called little endian. When the most significant byte (MSB) is stored first, it’s called big endian.

All systems are either big or little endian, and some have a register bit, which allows the user to choose the preferred endianness. When storing integers in a system file, the file might be sent to a machine that uses the other type of endianness. The numbers would be backward, and the message would not make any sense. Typically, when it is uncertain which endianness to use, something called network byte order comes into play. With this, integers are sent in groups of four bytes of either big or little endianness, picked at random, and the machine that receives the integers can reverse the bytes if the endiannesses do not match.

Endianness is only used when breaking something of large value, such as a word, into smaller parts. An order in which to store these parts in the system memory is then formed. It is not used when storing a value into a register that can hold all of it. In this case, all bits, right and left, are equally important.

Share
EasyTechJunkie is dedicated to providing accurate and trustworthy information. We carefully select reputable sources and employ a rigorous fact-checking process to maintain the highest standards. To learn more about our commitment to accuracy, read our editorial process.
Discussion Comments
Share
https://www.easytechjunkie.com/what-is-endianness.htm
Copy this link
EasyTechJunkie, in your inbox

Our latest articles, guides, and more, delivered daily.

EasyTechJunkie, in your inbox

Our latest articles, guides, and more, delivered daily.