Author Topic: Little/Big-Endian the most stupid term ever conceived.  (Read 9255 times)

0 Members and 6 Guests are viewing this topic.

Offline paulcaTopic starter

  • Super Contributor
  • ***
  • Posts: 6354
  • Country: gb
Little/Big-Endian the most stupid term ever conceived.
« on: May 28, 2025, 12:01:23 pm »
This has always bugged me as one of the most irritating, bugged, invalid and stupid terminology in common use.

Bigendian, littleendian.

WHICH "END" are your referring to, it has TWO?

It's a complete miss-statement.  An invalid logical construct.  Exception: "END" is not defined.

All "Little endian" tell you is that one of it's 'ends' is little.  All "Big endian" tell you is that one of it's 'ends' is big.

Nothing tells you which "end".

If you were to layman it and say, "Well the number/bit-field has a beginning and an end if you read left to right.... so it's the "furthest right".

It's not.

The end they are referring to is the start, the beginning the left most digit.... or is it?
"What could possibly go wrong?"
Current Open Projects:  68000 Self Build computer + OS.
 
The following users thanked this post: metertech58761, BC547B

Offline woody

  • Frequent Contributor
  • **
  • Posts: 631
  • Country: nl
Re: Little/Big-Endian the most stupid term ever conceived.
« Reply #1 on: May 28, 2025, 12:34:09 pm »
Yeah, I understand it upsets you.

I have the same with the term 'word'. I mean, you first have a bit, then a nibble, then you take a byte and then when you expect a 'meal' you get a word.

All very confusing 🤔
 
The following users thanked this post: Berni, nctnico, abeyer, metertech58761, BadeBhaiya, BC547B, UnijunctionTransistor

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 6398
  • Country: nz
Re: Little/Big-Endian the most stupid term ever conceived.
« Reply #2 on: May 28, 2025, 12:55:00 pm »
This has always bugged me as one of the most irritating, bugged, invalid and stupid terminology in common use.

The two terms do after all date from 1726, and applying them to computers was an in-joke in the first place.

But it is really very simple, with the same meaning for describing bits in a register or bytes in memory.

When you start from bit/byte 0 and go to 1, 2, 3 ... are you seeing the most significant (big) or least significant (little) bits or bytes first?

e.g. take the number 0x1234.

In a register:

Code: [Select]

Big endian

+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| 0| 0| 0| 1| 0| 0| 1| 0| 0| 0| 1| 1| 0| 1| 0| 0|
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15

Little Endian:

+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| 0| 0| 0| 1| 0| 0| 1| 0| 0| 0| 1| 1| 0| 1| 0| 0|
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
 15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0

In memory:

Code: [Select]

Big endian

0: 0x12
1: 0x34

Little endian

0: 0x34
1: 0x12

IBM quite consistently uses big-endian in both registers and memory, on both S/360 and POWER.

Modern practice tends to be to use little-endian in both registers and memory, and this extends back to DEC machines including PDP-11 and VAX.

Some cursed machines use little-endian in registers but big-endian in memory e.g. 68000

Simples.
« Last Edit: May 28, 2025, 01:06:42 pm by brucehoult »
 
The following users thanked this post: newbrain

Offline DiTBho

  • Super Contributor
  • ***
  • Posts: 5083
  • Country: gb
Re: Little/Big-Endian the most stupid term ever conceived.
« Reply #3 on: May 28, 2025, 01:04:55 pm »
This has always bugged me as one of the most irritating, bugged, invalid and stupid terminology in common use.

Bigendian, littleendian.

WHICH "END" are your referring to, it has TWO?

That's wahy in myC, the endian operator is defined as (source, target)[]={ BE_BE, BE_LE, LE_BE, LE_LE };
Even if actually only BE_LE() and LE_BE() do byte swapping.

But "endianness" is a property of an object.
e.g. of the local platform, and of the peripheral to which it interfaces.
e.g. of the local platform, and of the "disk partition" scheme (mac-part was only for PPC/BE)

So it is defined at only one end.
Then it is the language that takes care of the interfacing.

That's my way of handling it.
Unlike "classic C", where it is up to the programmer to take care of it.
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 

Offline jpanhalt

  • Super Contributor
  • ***
  • Posts: 4804
  • Country: us
Re: Little/Big-Endian the most stupid term ever conceived.
« Reply #4 on: May 28, 2025, 01:06:42 pm »
It's helpful to know when doing Assembly and indirect addressing, i.e., incrementing or decrementing a register location.  For me, it is a way to remember which to do, because I try to be consistent.  And of course, it does date from the Gulliver's Travels. 

BTW, when you crack an egg, do you do the big end or small end?  I find it makes a difference when peeling a hard-boiled egg.  I have no idea what C does.
 

Offline kwass

  • Frequent Contributor
  • **
  • Posts: 368
  • Country: us
Re: Little/Big-Endian the most stupid term ever conceived.
« Reply #5 on: May 28, 2025, 01:07:17 pm »
This has always bugged me as one of the most irritating, bugged, invalid and stupid terminology in common use.
The two terms do after all date from 1726, and applying them to computers was an in-joke in the first place.

Yes indeed. The originator of that phrase, Jonathan Swift, coined a bunch of words and phrases that have come into modern use (in the English speaking world) in one of his great works, Gulliver's Travels.
-katie
 
The following users thanked this post: UnijunctionTransistor

Offline DiTBho

  • Super Contributor
  • ***
  • Posts: 5083
  • Country: gb
Re: Little/Big-Endian the most stupid term ever conceived.
« Reply #6 on: May 28, 2025, 01:15:16 pm »
Modern practice tends to be to use little-endian in both registers and memory, and this extends back to DEC machines including PDP-11 and VAX.

The funny thing is that the R3000 used by Sony for PlayStation can run in BE or LE mode, depending on the configuration detected at bootstrap.
You just need to desolder a pin, add a pull-up resistor. Nothing difficult.

The same goes for POWER8 and 9. The endianess is set by the first 32bit-word fetched from the flash, they come with LE defaults, and all firmware is LE, but you can reprogram the firmware to make them BE.
(which, is a useful thing to do, because this way they are compatitible with PowerMac-G5, which are PPC64/BE)

The same goes for MIPS evaluation boards. For example, my Atlas, Algo and IDT boards have a physical dip-switch to set the CPU endianess.
Unfortunately, you can't change the endianess of the Ethernet network, nor the bus.
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 

Online wilfred

  • Super Contributor
  • ***
  • Posts: 1785
  • Country: au
Re: Little/Big-Endian the most stupid term ever conceived.
« Reply #7 on: May 28, 2025, 01:16:26 pm »

The two terms do after all date from 1726, and applying them to computers was an in-joke in the first place.


It came from Jonathan Swifts book Gulliver's Travels and was referring to the argument between two groups about which end of a boiled egg should be cracked. There were the big-endians and the little-endians. It is actually, in my opinion, one of the best appropriations of a cultural reference and entirely serves the purpose of transferring to the argument over which is better in computing. In both contexts you have to choose one and it is mostly arbitrary.
« Last Edit: May 28, 2025, 01:18:01 pm by wilfred »
 

Offline paulcaTopic starter

  • Super Contributor
  • ***
  • Posts: 6354
  • Country: gb
Re: Little/Big-Endian the most stupid term ever conceived.
« Reply #8 on: May 28, 2025, 01:25:20 pm »
This has always bugged me as one of the most irritating, bugged, invalid and stupid terminology in common use.

The two terms do after all date from 1726, and applying them to computers was an in-joke in the first place.

But it is really very simple, with the same meaning for describing bits in a register or bytes in memory.

When you start from bit/byte 0 and go to 1, 2, 3 ... are you seeing the most significant (big) or least significant (little) bits or bytes first?

e.g. take the number 0x1234.

In a register:

Code: [Select]

Big endian

+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| 0| 0| 0| 1| 0| 0| 1| 0| 0| 0| 1| 1| 0| 1| 0| 0|
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15

Little Endian:

+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| 0| 0| 0| 1| 0| 0| 1| 0| 0| 0| 1| 1| 0| 1| 0| 0|
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
 15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0

In memory:

Code: [Select]

Big endian

0: 0x12
1: 0x34

Little endian

0: 0x34
1: 0x12

IBM quite consistently uses big-endian in both registers and memory, on both S/360 and POWER.

Modern practice tends to be to use little-endian in both registers and memory, and this extends back to DEC machines including PDP-11 and VAX.

Some cursed machines use little-endian in registers but big-endian in memory e.g. 68000

Simples.

Nah.  Like USB cables it can only go up one way.
  •   If it doesn't work, try the other way.


It's far better than remembering which end.  This is exactly what I do with logic analysers etc.  In code it's,  usually, either abstracted into "you dont need to know" or plain as day in front of you.  The "middle ground" is firmware and it's normally very clear in the datasheet even to the point of showing diagrams like you just did, to not rely on those terms.  "MSB First".  is much better.



Big endian

+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| 0| 0| 0| 1| 0| 0| 1| 0| 0| 0| 1| 1| 0| 1| 0| 0|
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15

Little Endian:

+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| 0| 0| 0| 1| 0| 0| 1| 0| 0| 0| 1| 1| 0| 1| 0| 0|
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
 15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0


This is completely meaningless.  At the level you are deciding the endian-ness you are also defining the bit position values.  In my view "endian-ness" is a properties of the bit values.  Simply labelling them differently in ascending integers is an oxy moron is it not?

Is bit position 15 assumed to refer to 32k or 1?

  • Technically USB-A exists in a 4 dimensional space and there are in fact 3 different ways up.  To access the third, rotate it one more time in the Z axis.


« Last Edit: May 28, 2025, 01:29:46 pm by paulca »
"What could possibly go wrong?"
Current Open Projects:  68000 Self Build computer + OS.
 

Offline DiTBho

  • Super Contributor
  • ***
  • Posts: 5083
  • Country: gb
Re: Little/Big-Endian the most stupid term ever conceived.
« Reply #9 on: May 28, 2025, 01:25:50 pm »
Gulliver's Travels.

Which side do you crack an egg on?
The narrow end (LE), or the wide end (BE)?

That's a problem, isn't it? :o :o :o
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 6398
  • Country: nz
Re: Little/Big-Endian the most stupid term ever conceived.
« Reply #10 on: May 28, 2025, 01:44:14 pm »
"MSB First".  is much better.

"first" only has meaning in serial data transfer (whether bit at a time or byte at a time etc).  It has no obvious meaning when referring to a parallel physical structure such as a register or RAM.

x86 is little-endian, right?  So when you do something with two halves of a value you should do it with the little end first, right?

Code: [Select]
MOV EDI,ECX
STOSW AX
ROL EAX,16
STOSW AX
MOV EAX,[ECX]

EAX now contains the same thing as it started with, right?

Right.

Code: [Select]
PUSH AX
ROL EAX,16
PUSH AX
POP EAX

EAX now contains the same thing as it started with, right?

Wrong.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 23122
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Little/Big-Endian the most stupid term ever conceived.
« Reply #11 on: May 28, 2025, 02:13:09 pm »
This has always bugged me as one of the most irritating, bugged, invalid and stupid terminology in common use.

The two terms do after all date from 1726, and applying them to computers was an in-joke in the first place.

Computer pioneers and academics were widely read, so everybody recognised that reference. :)

Nowadays "reading widely" means consuming both TackyTok and Farcebook. :(
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline jpanhalt

  • Super Contributor
  • ***
  • Posts: 4804
  • Country: us
Re: Little/Big-Endian the most stupid term ever conceived.
« Reply #12 on: May 28, 2025, 02:25:20 pm »
Yes indeed. The originator of that phrase, Jonathan Swift, coined a bunch of words and phrases that have come into modern use (in the English speaking world) in one of his great works, Gulliver's Travels.

My favorite is Yahoo, and not surprisingly, Google AI gives a cleaned up version for the well-known eponymous search engine.
« Last Edit: May 28, 2025, 02:28:47 pm by jpanhalt »
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 17772
  • Country: fr
Re: Little/Big-Endian the most stupid term ever conceived.
« Reply #13 on: May 28, 2025, 02:48:55 pm »
Maybe you can join the "dB" gang. :-//
 
The following users thanked this post: UnijunctionTransistor

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 23122
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Little/Big-Endian the most stupid term ever conceived.
« Reply #14 on: May 28, 2025, 02:50:05 pm »
Maybe you can join the "dB" gang. :-//

That thought had crossed my mind!
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 6398
  • Country: nz
Re: Little/Big-Endian the most stupid term ever conceived.
« Reply #15 on: May 28, 2025, 03:49:31 pm »

Big endian

+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| 0| 0| 0| 1| 0| 0| 1| 0| 0| 0| 1| 1| 0| 1| 0| 0|
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15

Little Endian:

+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| 0| 0| 0| 1| 0| 0| 1| 0| 0| 0| 1| 1| 0| 1| 0| 0|
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
 15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0


This is completely meaningless.  At the level you are deciding the endian-ness you are also defining the bit position values.  In my view "endian-ness" is a properties of the bit values.  Simply labelling them differently in ascending integers is an oxy moron is it not?

It is not meaningless.  The binary digits inside the boxes are the standard binary representation of the example number 0x1234, written as we normally write it in Western culture i.e. 0001 0010 0011 0100


Quote
Is bit position 15 assumed to refer to 32k or 1?

Bit position 15 represents 1 in big-endian, 32768 in little-endian, as shown in the diagrams.

This is important in ISAs that have individual instructions to extract or insert bit fields, or to set / clear / complement / test individual numbered bits.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 23122
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Little/Big-Endian the most stupid term ever conceived.
« Reply #16 on: May 28, 2025, 03:57:22 pm »
This is important in ISAs that have individual instructions to extract or insert bit fields, or to set / clear / complement / test individual numbered bits.

And some processor families have called the most significant bit 31, others called it 0!
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 6398
  • Country: nz
Re: Little/Big-Endian the most stupid term ever conceived.
« Reply #17 on: May 28, 2025, 04:08:45 pm »
This is important in ISAs that have individual instructions to extract or insert bit fields, or to set / clear / complement / test individual numbered bits.

And some processor families have called the most significant bit 31, others called it 0!

??

That is PRECISELY what my diagrams were drawn to illustrate. (though for 16 bit values not 32)
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 17772
  • Country: fr
Re: Little/Big-Endian the most stupid term ever conceived.
« Reply #18 on: May 28, 2025, 04:17:32 pm »
To be fair, this is one of those terms that have acquired conventional meaning, but are intrisically a bit "loose". Like "byte", and its multipliers (KB, MB, etc).
"Byte" usually refers to 8-bit words, but not always.
"KB" usually refers to 1024 bytes, but not always.

Mor or less all those terms are context-dependent. You can remove ambiguity by defining them when using them. A bit of a hassle.

Recent specs and standards now tend to favor "octet" to refer to 8-bit words, rather than "byte". Likewise, the power-of-two multipliers have been standardized to Ki, Mi, etc to remove ambiguity and make them context-free.

Unfortunately, many people seem to whine about terms being ambiguous, and then later whine about attempts to remove ambiguities. TL;DR: you can't please everyone.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 23122
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Little/Big-Endian the most stupid term ever conceived.
« Reply #19 on: May 28, 2025, 04:56:05 pm »
This is important in ISAs that have individual instructions to extract or insert bit fields, or to set / clear / complement / test individual numbered bits.

And some processor families have called the most significant bit 31, others called it 0!

??

That is PRECISELY what my diagrams were drawn to illustrate. (though for 16 bit values not 32)

Yes, you're right. :(

I didn't bother to read the details since I've only seen big/little endian refer to 8/16/32 bit units, normally but not exclusively in conjunction with network protocols and debugger output.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline TimFox

  • Super Contributor
  • ***
  • Posts: 11887
  • Country: us
  • Retired, now restoring antique test equipment
Re: Little/Big-Endian the most stupid term ever conceived.
« Reply #20 on: May 28, 2025, 05:04:59 pm »
See my detailed response to another thread citing this one, which quotes the original Swift text:
https://www.eevblog.com/forum/chat/decibels-are-ridiculous/msg5928910/#msg5928910
 

Online langwadt

  • Super Contributor
  • ***
  • Posts: 5755
  • Country: dk
Re: Little/Big-Endian the most stupid term ever conceived.
« Reply #21 on: May 28, 2025, 06:31:41 pm »
This is important in ISAs that have individual instructions to extract or insert bit fields, or to set / clear / complement / test individual numbered bits.

And some processor families have called the most significant bit 31, others called it 0!

calling the most significant bit 0 only makes sense for binary fractions
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 11140
  • Country: fi
Re: Little/Big-Endian the most stupid term ever conceived.
« Reply #22 on: May 28, 2025, 07:02:10 pm »
It's an excellent term, because it's distinguishable; meaning, in today's world, it's also googlable. So good for the same reason as Ethernet. It makes no sense, and it doesn't need to, because it's just a name for a thing, a label. It is however much better name than "CAN" or "TLA", which are ungooglable.

I'm of course not a native English speaker or writer, but I have never heard term "endian" in any other meaning in everyday language*. It sounds like totally made-up to me. Which is great, because it breaks free from existing connotations...

WHICH "END" are your referring to, it has TWO?

It's a complete miss-statement.  An invalid logical construct.  Exception: "END" is not defined.

... which you try to forcefully add here, so that you can complain.

*) I have heard it's in some book or something, which I haven't read
« Last Edit: May 28, 2025, 07:06:35 pm by Siwastaja »
 
The following users thanked this post: voltsandjolts

Offline TimFox

  • Super Contributor
  • ***
  • Posts: 11887
  • Country: us
  • Retired, now restoring antique test equipment
Re: Little/Big-Endian the most stupid term ever conceived.
« Reply #23 on: May 28, 2025, 07:14:00 pm »
Swift's Gulliver's Travels is an English-language classic (18th Century), not so often read anymore, but the concept of visiting countries with very different sized individuals is very common in animated cartoons and similar media.
See:  https://www.eevblog.com/forum/chat/decibels-are-ridiculous/msg5928910/#msg5928910
 

Offline paulcaTopic starter

  • Super Contributor
  • ***
  • Posts: 6354
  • Country: gb
Re: Little/Big-Endian the most stupid term ever conceived.
« Reply #24 on: May 28, 2025, 07:39:41 pm »
... which you try to forcefully add here, so that you can complain.

I an not a language nerd, but it's a word constructed exactly like other latin/english words.

"End" is the 'thing"
"ian" suffix meaning - "of" or "from"

Freudian - of Freud or from Freud.

Endian is "Of ends".  Big endian - of big ends.

So unlike "output" an "input" it even attempts to fit the english language constructs of how words get formed from others with suffixes/prefixes.

Endianness, endianality.... I am taking the piss now.

I think its a latin-english thing.
"What could possibly go wrong?"
Current Open Projects:  68000 Self Build computer + OS.
 
The following users thanked this post: BC547B


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf