What are little-endian and big-endian formats?
Let’s say we are storing the multibyte data 0x12345678 in computer memory. Now, we can do so in two different ways. We can store the least significant byte of the multibyte data first and the most significant byte of the multibyte data last. In other words, we can store 0x78 in the first memory location, 0x56 in the next memory location, and so on, and 0x12 in the last memory location. This type of sequence or order in storing multibyte data is called little endianness.
Big endianness is the sequence or order of storing multi-byte data in which the most significant byte of the multibyte data is stored first and the least significant byte of the multibyte data is stored last. So, in our example, if we are storing the multibyte data 0x12345678 in memory, 0x12 will be stored in the first memory location, 0x34 in the next memory location, and so on and 0x78 will be stored in the last memory location.
Where are little-endian and big-endian formats used?
Some processor architectures follow the little-endian format and some processor architectures follow the big-endian format. For example, IA-32 and x64 follow the little-endian format. And, OpenRISC and z/Architecture follow the big-endian format.










































0 Comments