Geek And Poke
Cartoons
Home
September 07, 2011
Simply Explained
Tweet
Sep 7, 2011 12:24:47 AM
NEXT POST
Simply Explained
Tweet
PREVIOUS POST
Simply Explained
Updated: Typo fixed (thanks to all!) Tweet
Oliver Widder
I'm a IT-guy in Hamburg, Germany
1
Following
319
Followers
Search
My Other Accounts
Twitter
|
geekandpoke
Recent Comments
Wolf:
DELETE top, pants, bra FROM women WHERE sexylev...
|
more »
On
commands.sql
Cyrus McDugan:
Does that really work? I can tell you, that it ...
|
more »
On
commands.sql
Michael:
Dad? What is a floppy drive? :-D Im getting soo...
|
more »
On
The Social Generation
Forgot about middle-endian?
Posted by: Maki | September 07, 2011 at 03:11 AM
Nicely illustrated.
Sometimes I mix the meaning of little endian and big endian. I got confuse which one is which. But remembering this illustration would really help.
Nice one.
(http://codedincantation.com/)
Posted by: http://codedincantation.com/ | September 07, 2011 at 03:29 AM
The nose is the most significant, the tail the least significant part? I guess the pig would agree, the butcher definitely wouldn't.
Posted by: Stim | September 07, 2011 at 08:45 AM
Nailed it.
Posted by: Fred | September 07, 2011 at 09:48 AM
Don't get it! What is the point?
I would expect the little-endian pig to head right. Some more information, please :)
Posted by: Michael Menzel | September 07, 2011 at 11:54 AM
I don't get it.
big-endian store values left to right and little-endian right to left.
Your little-endian looks like a middle-endian :-)
Posted by: Paul | September 07, 2011 at 12:16 PM
Actually, big-endian and little endian doens't have a shift.
One would be the reflection of the other.
So the second picture should be the pig looking to the other side.
Posted by: FelipeVR | September 07, 2011 at 03:15 PM
super!!!!!!!!! lol
Posted by: kate | September 07, 2011 at 05:16 PM
Nice 16-bit sample of little/big endian. Could you also provie 32-bit and 64-bit samples, i.e. 4 slices or 8 slices of that pig?
Posted by: MaSm | September 07, 2011 at 10:17 PM
This is the reason why the only valid way to encode unicode is UTF8.
Posted by: Notan | September 08, 2011 at 08:07 AM
Haha, okay, so which end is most significant on a pig?
Posted by: D | September 08, 2011 at 05:39 PM
:D
Posted by: Ulrich Tewes | September 09, 2011 at 08:36 PM
And it's still wrong: '(1 << (index % (8 * sizeof(*ptr)))) & ptr[index / (8 * sizeof (*ptr))]' only addresses the same bit independent of whether ptr ist char, short, int or long when it is a little-endian machine.
What is actually wrong, and why hex dumps look good on big-endian machines is that we order bits within the byte differently than we order bytes in the usual hex dump. The poor big endian pig only looks good because we chopped it up twice. :-)
Posted by: Akrey | September 10, 2011 at 10:00 AM
This is actually the best depiction of "pig-endianness" that I have ever seen! :-)
(And it's totally precise as well.)
Posted by: Markus | September 11, 2011 at 05:21 PM
There seems to be some confusion in the comments (eg. should it be a left-to-right facing pig).
The image is correct. It conveys the important fact that this is about BYTE order, not BIT order.
It should also not be confused with serial communications.
Posted by: Mark | September 21, 2011 at 05:43 PM