This post explains the concept of endianness of data .
The endianness of a data tells about the order in which the most significant byte or least significant byte in a large data item are stored in least memory address.
When the most significant byte in the large data item is stored at least memory address it is called Big-Endiann system.
When the least significant byte in the large data item is stored at least memory address it is called Little-Endiann system.
In brief the endiannes depends on which byte( Most significant or Least significant ) is stored at the first (least memory) address.
Here is the explanation with an example:
Lets take the IP address of the local host i.e 127.0.0.1 ( dotted decimal notation).
Now if the system we use is Big-Endian then the bytes are stored from least significant byte (LSB) at the first address(least memory address) followed by next byte etc.
The endianness of a data tells about the order in which the most significant byte or least significant byte in a large data item are stored in least memory address.
When the most significant byte in the large data item is stored at least memory address it is called Big-Endiann system.
When the least significant byte in the large data item is stored at least memory address it is called Little-Endiann system.
In brief the endiannes depends on which byte( Most significant or Least significant ) is stored at the first (least memory) address.
Here is the explanation with an example:
Lets take the IP address of the local host i.e 127.0.0.1 ( dotted decimal notation).
Now if the system we use is Big-Endian then the bytes are stored from least significant byte (LSB) at the first address(least memory address) followed by next byte etc.
| LeastMemoryAddress+3 | LeastMemoryAddress+2 | LeastMemoryAddress+1 | LeastMemoryAddress |
| 127 | 0 | 0 | 1 |
Now if the system we use is Little-Endian then the bytes are stored from Most significant byte (MSB) at the first address(least memory address) followed by next byte etc.
| LeastMemoryAddress+3 | LeastMemoryAddress+2 | LeastMemoryAddress+1 | LeastMemoryAddress |
| 1 | 0 | 0 | 127 |
No comments:
Post a Comment