Monday, August 2, 2010

Endianness

Before i start with this post, i would like to share with my friends that this my first experience at bloging or any sort of posting on the net, i hope it is worth your precious time....

Endianness deals with integer representation in a computer . Now, we all know that there are certain human languages that are read from left to right like English,Hindi and then there are some languages like Arabic that are read from right to left.Similarly, integers are represented as sequence of bytes with the most significant byte on the left(The Big Endian),in some representations, while in others it is placed on the right(The little Endian).

Now lets see the main advantage of the two systems:-
1)The little Endian system has the property that the same value can be read from the memory at different lengths... Therefore, the value read from 32-bit memory can be read from the same address as either 16-bit memory or 8-bit memory. all of which retain the same numeric value.
2)The big Endian representation helps to obtain an approximation of the multi-byte value by reading the most significant portion instead of the complete representation.


Address Big-Endian representation of 1025 Little-Endian representation of 1025
00 00000000 00000001
01 00000000 00000100
02 00000100 00000000
03 00000001 00000000

For moe info, you can use the following links:-
http://en.wikipedia.org/wiki/Endianness
http://3bc.bertrand-blanc.com/endianness05.pdf

6 comments:

  1. Nice effort as a first blog post! Keep it up. :)

    Could you please elaborate the two advantages that you written by supplementing them with a few examples? I could not understand it completely.

    ReplyDelete
  2. The last bit that you wrote about Big Endian and Little Endian representation of 1025, could u explain it better please?
    I'm not clear what exactly you are trying to showcase with that example.

    ReplyDelete
  3. Could u please explain the last portion of your blog with a little more clarity?also highlight the corresponding figures..

    'Address Big-Endian representation of 1025 Little-Endian representation of 1025'

    ReplyDelete
  4. I didn't understand the properties and also the example in the end - "Address Big-Endian representation of 1025 Little-Endian representation of 1025" :|

    ReplyDelete
  5. I m so sorry for making a mess of it at the end... Honestly, I too didnt understand it after reading the post....
    now,as stated above- The little-endian system has the property that the same value can be read from memory at different lengths without using different addresses. For example, a 32-bit memory location with content 00 00 00 4A can be read at the same address as either 8-bit (value = 4A), 16-bit (004A), 24-bit (00004A), or 32-bit (0000004A), all of which retain the same numeric value.
    When talking of the Big-Endian system- since the numbers are stored from left to right, you can make an approximation... It will be easier to understand if we compare it with the normal numbers we come across.

    ReplyDelete
  6. i suggest you view pg 6 of the pdf at the following link
    http://3bc.bertrand-blanc.com/endianness05.pdf
    That will clear the picture for you...

    ReplyDelete