Big Ending and Little Ending Explained
Posted: Fri Sep 09, 2011 6:54 am
when we store data in computer memory, there are basically two ways of storing them. Simply one way is store the big byte first or storing the small byte first.
The term “big-ending” or “little-ending” is comming from the Gulliver’s Travel Advanture movie,where the “liliputians” are divided into two camps , who start to ate the egg from little and and who start to ate the egg from the big end.
The same meaning is there on the computing world. In little ending, you first store the lowerst byte , and in the big ending you store the most significiant byte first. Computing world also politically discriminated into these two categories, discrimination is everywhere in the world where computing is not just exception to it.
To make this clear , let’t take a look at a example. Suppose you need to store 12345678H (hexadecimal) value in compuer memory. In C programming language you can simply write.
If you took a logic probe and hack your computer memory and see , and if your computer is little ending you can find it like this. Please suppose that &i=0x0100h or address of i is situated at the memory location 0x0100h.
value 0x12345678h was stored in a little ending machine’s memory.
value 0x12345678h was stored in a big ending machine’s memory
And if you’r not touching assembly language/system programming or file types and I/O and you programming in a high level language like C/C++/Java probablly you don’t need to familar with the difference between little-big ends.
If you’r writing the network protocols or writing a device driver code for a networking interface then you should probablly know that all the networking communication is goes in big-ending representation. When you doing programming with sockets or higher level API you’ll met very rare cases you need to deal with this fact.
However if you want to deal with the file formats ,again this counts.For a example BMP,GIF and RTF are file formats that are examples for the “little ending” format. and JPEG is a example for “big ending”. Some file formats like AVI, WAV,TIFF supports both endings.
--happy coding--
--sandun--
The term “big-ending” or “little-ending” is comming from the Gulliver’s Travel Advanture movie,where the “liliputians” are divided into two camps , who start to ate the egg from little and and who start to ate the egg from the big end.
The same meaning is there on the computing world. In little ending, you first store the lowerst byte , and in the big ending you store the most significiant byte first. Computing world also politically discriminated into these two categories, discrimination is everywhere in the world where computing is not just exception to it.
To make this clear , let’t take a look at a example. Suppose you need to store 12345678H (hexadecimal) value in compuer memory. In C programming language you can simply write.
Code: Select all
int i = 0×12345678;
value 0x12345678h was stored in a little ending machine’s memory.
value 0x12345678h was stored in a big ending machine’s memory
And if you’r not touching assembly language/system programming or file types and I/O and you programming in a high level language like C/C++/Java probablly you don’t need to familar with the difference between little-big ends.
If you’r writing the network protocols or writing a device driver code for a networking interface then you should probablly know that all the networking communication is goes in big-ending representation. When you doing programming with sockets or higher level API you’ll met very rare cases you need to deal with this fact.
However if you want to deal with the file formats ,again this counts.For a example BMP,GIF and RTF are file formats that are examples for the “little ending” format. and JPEG is a example for “big ending”. Some file formats like AVI, WAV,TIFF supports both endings.
--happy coding--
--sandun--