Niko O
Niko O

Reputation: 437

Why does Big Endian end with the little byte?

It is common to say that the "end" of a memory (or a memory segment) has the highest address. For example: Program Counters are typically incremented (not decremented) and the code is executed from "start" to "end", so the instruction at the end of the program is located at the highest address (not the lowest one).

The BigEndian convention specifies that the biggest byte (i.e. the most significant byte) is located at the lowest address (i.e. the start of the memory). Shouldn't it be the other way around? It's BigEndian, not BigStartian.

Similarly LittleEndian specifies that the smallest byte is located at the start of the memory instead of at the end.

Why is it backwards?

Upvotes: 3

Views: 263

Answers (2)

that other guy
that other guy

Reputation: 123470

It's using "end" to mean "adjacent to an extremity", just like:

  • You burn a candle at both ends, not at the start and at the end.
  • A loaf of bread has two end pieces, but no start piece.
  • You can be seated at opposite ends of a table, but not at the start and end.

A number like 1234567 has two ends, and you can store either the big end (a million) or the little end (seven) first.

Upvotes: 1

kittykittybangbang
kittykittybangbang

Reputation: 2400

As per the illustrious Wikipedia:

In 1726, Jonathan Swift described in his satirical novel Gulliver’s Travels tensions in Lilliput and Blefuscu: whereas royal edict in Lilliput requires cracking open one's soft-boiled egg at the small end, inhabitants of the rival kingdom of Blefuscu crack theirs at the big end, giving them the moniker Big-endians. The terms little-endian and endianness have a similar intent.

So if we look at it in this context, an x-endian is he who begins at the x end. Thus, a big-endian is he who begins at the "big" end, so to speak, of a value, and vice versa.

Upvotes: 4

Related Questions