Shouldn't endian definitions be reversed?
Asked Answered
F

2

10

I have worked a lot with byte streams so I understand the concept - some bytes signify a higher numerical value than others.

When reading the wiki on the definitions I become very confused though.

When I see the word "Big-endian" or BIG + END what I expect is that the last/ending byte is the biggest. No brainer right?

Example for those who don't know about endianness at all: Bytes 0x01 0x00, stored at index 0 and index 1, would be equal to 1 with the last byte being significant and equal to 256 with the first byte being significant. (A byte gives 2^8 options and 2^8 = 256)

Obviously if the last byte is most significant I would call that "big endian".

But no, reading wikipedia the definitions are the exact opposite: Last byte significance is called little-endian and first byte significance is called big-endian.

What gives?

Fiorenze answered 21/11, 2015 at 11:34 Comment(6)
I usually remember it as big-endian having the big end (of the number) first, and little-endian having the little end (of the number) first.Shirt
The whole point of a definition is that everybody has the same understanding. So changing a definition is stupid as you would have to tell the reader what version of the definition you are usingMcburney
But why is it like that? It is like if we defined that water is red even though its not. Everyone would call it red and understand it, but it would not fit reality. (Mind you in this thought experiment we did not reverse 'red' and 'blue' - blue flowers would still be called 'blue'.)Fiorenze
Also changing a definition or standards is not necessarily stupid, remember how we shifted to metric because what came before was insane? Anyway I don't want to change it - even though it is counter intuitive - I'm just asking why it is like that. What is the historical reason behind it?Fiorenze
Things have two ends, and it seems less logical to use the far/last end than the near/first one.Pyrotechnic
I have the exact feeling for years and the wikipedia article also confused me until I found this question! I guess the problem here is the "-endian". Using it as suffix of little/big makes people think it is auxiliary to the word 'end', intuitively "big or little in the end". This is especially true for non-native English speakers. But as Anton said, it's just endianness preference to start data consumption.Dardar
L
7

Well, historically, those terms come from Gulliver's Travels (yeah, everyone has Wikipedia), where they meant the end that's used to crack a boiled egg. Since that end is likely to be pointing down, it can be associated with a lower address. Also, one is using that end to 'consume', or 'process' an egg, and processing data typically starts from lower addresses. That said, one can argue that one doesn't have to know the origins of a term to correctly interpret it. But anyway, on almost any subject there are 'two types of people', so what's obvious to one group will likely be counter-intuitive to the other.

Loot answered 21/11, 2015 at 12:2 Comment(1)
Thanks. I guess I'm just in the other camp then being difficult and all... well let me tell you I'm quite happy not having to think about eggs while coding :) I'll just use "last-significant" for LE in my comments I think.Fiorenze
G
3

Do not think of the word end as the one final part or as the temporally last component.

Instead think of the word end as either of the two spatial extremities of a long object such as a broom or a spoon (or an egg!). So the long object can have two orientations, "wrong end first" or "right (correct) end first". Now for a broom or a spoon most people can agree which orientation is right and which is wrong (bad "end"). However for a pair of data values, some people prefer one end first, others prefer the opposite end first.

See Anton's answer for the original parody on which end of a boiled egg to eat from.

Geometry answered 21/11, 2015 at 12:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.