[Tutor] little/big endian was Re: what is 'doubleword alignment'?

Dave Angel d at davea.name
Thu Jul 21 04:34:24 CEST 2011


On 07/19/2011 05:43 PM, Alan Gauld wrote:
> Albert-Jan Roskam wrote:
> > and ctypes to process the data in python. It works now, although I
> > still want to read more about this. Where does the distinction
> > little/big endian enter this story?
>
> That's to do with which bit in a byte/word is most significant.
>
> e.g. is the decimal value 1 stored as
>
> 00000001   # the one on the right hand nibble
> or as
> 00010000   # the one on the left hand nibble
>
> Now scale that up to word sized numbers...
> Different CPUs do it differently.
>
> I can't recall which is which - I'm sure wikipedia will
> reveal all! :-)
Little-endian is the method used by the Intel processor (such as the 
Pentium).  Big-endian is the system used by most network protocols, as 
well as the 68000 and many other processors.

For our purposes, it's the ordering of the bytes within a 16 or 32 bit 
number.  Little-endian puts the least significant byte first, while 
big-endian puts the most significant byte first.

-- 

DaveA



More information about the Tutor mailing list