|---word0---|---word1---|---word2---|....
In order to be consistent, B0 should be to the left of B31. If the bytes in a word are designated as C0 through C3 then C0 is also to the left of C3. Hence we get
|---word0---|---word1---|---word2---|....
|C0,C1,C2,C3|C0,C1,C2,C3|C0,C1,C2,C3|.....
|B0......B31|B0......B31|B0......B31|......
If we also use the traditional convention, as introduced by our numbering system, the wide-end is on the left and the narrow-end is on the right. Hence, the above is a perfectly consistent view of the world as depicted by the Big-Endians. Significance consistency decreases as the item numbers (address) increases. Many computers share with the Big-Endians this view about order. In many of their diagrams the registers are connected such that when the word W(n) is shifted right, its LSB moves into the MSB of word W(n+1). English text strings are stored in the same order, with the first character in C0 of W0, the next in C1 of W0, and so on. This order is very consistent with itself and with the English language. On the other hand, the Little-Endians have their view, which is different but also self-consistent. They believe that one should start with the narrow end of every word, and that low addresses are of lower order than high addresses. Therefore they put their words on paper as if they were written in Hebrew, like this:
...|---word2---|---word1---|---word0---|
When they add the bit order and the byte order they get:
...|---word2---|---word1---|---word0---| ....|C3,C2,C1,C0|C3,C2,C1,C0|C3,C2,C1,C0| .....|B31......B0|B31......B0|B31......B0|
In this regime, when word W(n) is shifted right, its LSB moves into the MSB of word W(n-1). English text strings are stored in the same order, with the first character in C0 of W0, the next in C1 of W0, and so on. This order is very consistent with itself, with the Hebrew language, and (more importantly) with mathematics, because significance increases with increasing item numbers (address). It has the disadvantage that English character streams appear to be written backwards; this is only an aesthetic problem but, admittedly, it looks funny, especially to speakers of English. In order to avoid receiving strange comments about this orders the Little-Endians pretend that they are Chinese, and write the bytes, not right-to-left but top-to-bottom, like:
C0: "J"
C1: "O"
C2: "H"
C3: "N"
..etc..
Note that there is absolutely no specific significance whatsoever to the
notion of "left" and "right" in bit order in a computer memory. One
could think about it as "up" and "down" for example, or mirror it by
systematically interchanging all the "left"s and "right"s. However,
this notion stems from the concept that computer words represent
numbers, and from the old mathematical tradition that the wide-end of a
number (aka the MSB) is called "left" and the narrow-end of a number is
called "right".
This mathematical convention is the point of reference for the notion of
"left" and "right".
It is easy to determine whether any given computer system was designed
by Little-Endians or by Big-Endians. This is done by watching the way
the registers are connected for the "COMBINED-SHIFT" operation and for
multiple-precision arithmetic like integer products; also by watching
how these quantities are stored in memory; and obviously also by the
order in which bytes are stored within words. Don't let the B0-to-B31
direction fool you!! Most computers were designed by Big-Endians, who
under the threat of criminal prosecution pretended to be Little-Endians,
rather than seeking exile in Blefuscu. They did it by using the
B0-to-B31 convention of the Little-Endians, while keeping the
Big-Endians' conventions for bytes and words.
The PDP10 and the 360, for example, were designed by Big-Endians: their
bit order, byte-order, word-order and page-order are the same. The same
order also applies to long (multi-word) character strings and to
multiple precision numbers.
Next, let's consider the new M68000 microprocessor. Its way of storing
a 32-bit number, xy, a 16-bit number, z, and the string "JOHN" in its
16-bit words is shown below (S = sign bit, M = MSB, L = LSB):
SMxxxxxxx yyyyyyyyL SMzzzzzzL "J" "O" "H" "N"
|--word0--|--word1--|--word2--|--word3--|--word4--|....
|-C0-|-C1-|-C0-|-C1-|-C0-|-C1-|-C0-|-C1-|-C0-|-C1-|.....
|B15....B0|B15....B0|B15....B0|B15....B0|B15....B0|......
The M68000 always has on the left (i.e., LOWER byte- or word-address) the wide-end of numbers in any of the various sizes which it may use: 4 (BCD), 8, 16 or 32 bits. Hence, the M68000 is a consistent Big-Endian, except for its bit designation, which is used to camouflage its true identity. Remember: the Big-Endians were the outlaws. Let's look next at the PDP11 order, since this is the first computer to claim to be a Little-Endian. Let's again look at the way data is stored in memory:
"N" "H" "O" "J" SMzzzzzzL SMyyyyyyL SMxxxxxxL
....|--word4--|--word3--|--word2--|--word1--|--word0--|
.....|-C1-|-C0-|-C1-|-C0-|-C1-|-C0-|-C1-|-C0-|-C1-|-C0-|
......|B15....B0|B15....B0|B15....B0|B15....B0|B15....B0|
The PDP11 does not have an instruction to move 32-bit numbers. Its
multiplication products are 32-bit quantities created only in the
registers, and may be stored in memory in any way. Therefore, the
32-bit quantity, xy, was not shown in the above diagram.
Hence, the above order is a Little-Endians' consistent order. The PDP11
always stores on the left (i.e., HIGHER bit- or byte-address) the
wide-end of numbers of any of the sizes which it may use: 8 or 16 bits.
However, due to some infiltration from the other camp, the registers of
this Little-Endian's marvel are treated in the Big-Endians' way: a
double length operand (32-bit) is placed with its MSB in the lower
address register and the LSB in the higher address register. Hence,
when depicted on paper, the registers have to be put from left to right,
with the wide end of numbers in the LOWER-address register. This
affects the integer multiplication and division, the combined-shifts and
more. Admittedly, Blefuscu scores on this one.
Later, floating-point hardware was introduced for the PDP11/45.
Floating-point numbers are represented by either 32- or 64-bit
quantities, which are 2 or 4 PDP11 words. The wide end is the one with
the sign bit(s), the exponent and the MSB of the fraction. The narrow
end is the one with the LSB of the fraction. On paper these formats are
clearly shown with the wide end on the left and the narrow on the right,
according to the centuries old mathematical conventions.
However, due to some oversights in the security screening process, the
Blefuscuians took over, again. They assigned, as they always do, the
wide end to the LOWer addresses in memory, and the narrow to the HIGHer
addresses.
Let "xy" and "abcd" be 32- and 64-bit floating-point numbers,
respectively. Let's look how these numbers are stored in memory:
ddddddddL ccccccccc bbbbbbbbb SMaaaaaaa yyyyyyyyL SMxxxxxxx
....|--word5--|--word4--|--word3--|--word2--|--word1--|--word0--|
.....|-C1-|-C0-|-C1-|-C0-|-C1-|-C0-|-C1-|-C0-|-C1-|-C0-|-C1-|-C0-|
......|B15....B0|B15....B0|B15....B0|B15....B0|B15....B0|B15....B0|
Well, Blefuscu scores many points for this. The above reference in does not even try to camouflage it by any Chinese notation. Encouraged by this success, as minor as it is, the Blefuscuians tried to pull another fast one. This time it was on the VAX, the sacred machine which all the Little-Endians worship. Let's look at the VAX order. Again, we look at the way the above data (with xy being a 32-bit integer) is stored in memory:
"N" "H" "O" "J" SMzzzzzzL SMxxxxxxx yyyyyyyyL ...ng2-------|-------long1-------|-------long0-------| ....|--word4--|--word3--|--word2--|--word1--|--word0--| .....|-C1-|-C0-|-C1-|-C0-|-C1-|-C0-|-C1-|-C0-|-C1-|-C0-| ......|B15....B0|B15....B0|B15....B0|B15....B0|B15....B0|
What a beautifully consistent Little-Endians' order this is !!! So, what about the infiltrators? Did they completely fail in carrying out their mission? Since the integer arithmetic was closely guarded they attacked the floating point and the double-floating which were already known to be easy prey. Let's look, again, at the way the above data is stored, except that now the 32-bit quantity xy is a floating point number: now this data is organized in memory in the following Blefuscuian way:
"N" "H" "O" "J" SMzzzzzzL yyyyyyyyL SMxxxxxxx ...ng2-------|-------long1-------|-------long0-------| ....|--word4--|--word3--|--word2--|--word1--|--word0--| .....|-C1-|-C0-|-C1-|-C0-|-C1-|-C0-|-C1-|-C0-|-C1-|-C0-| ......|B15....B0|B15....B0|B15....B0|B15....B0|B15....B0|
Blefuscu scores again. The VAX is found guilty, however with the
explanation that it tries to be compatible with the PDP11.
Having found themselves there, the VAXians found a way around this
unaesthetic appearance: the VAX literature (e.g., p. 10 of [4])
describes this order by using the Chinese top-to-bottom notation, rather
than an embarrassing left-to-right or right-to-left one. This page is a
marvel. One has to admire the skillful way in which some quantities are
shown in columns 8-bit wide, some in 16 and other in 32, all in order to
avoid the egg-on-the-face problem.....
By the way, some engineering-type people complain about the "Chinese"
(vertical) notation because usually the top (aka "up") of the diagrams
corresponds to "low"-memory (low addresses). However, anyone who was
brought up by computer scientists, rather than by botanists, knows that
trees grow downward, having their roots at the top of the page and their
leaves down below. Computer scientists seldom remember which way "up"
really is.
Having scored so easily in the floating point department, the
Blefuscuians moved to new territories: Packed-Decimal. The VAX is also
capable of using 4-bit-chunk decimal arithmetic, which is similar to the
well known BCD format.
The Big-Endians struck again, and without any resistance got their way.
The decimal number 12345678 is stored in the VAX memory in this order:
7 8 5 6 3 4 1 2 ...|-------long0-------| ....|--word1--|--word0--| .....|-C1-|-C0-|-C1-|-C0-| ......|B15....B0|B15....B0|
This ugliness cannot be hidden even by the standard Chinese trick.
time time
| |
\ | | /
\ | | /
\ | | /
\ | | /
\ | | /
\ | | /
\ | | /
\ | | /
\ | | /
\ | | /
\ | | /
\ | | /
\ | | /
\ | | /
\ | | /
\ | | /
<-MSB---------------LSB- -MSB---------------LSB->
order (1) | | order (2)
time time
| |
/ | | \
/ | | \
/ | | \
/ | | \
/ | | \
/ | | \
/ | | \
/ | | \
/ | | \
/ | | \
/ | | \
/ | | \
/ | | \
/ | | \
/ | | \
/ | | \
<-MSB---------------LSB- -MSB---------------LSB->
order (3) | | order (4)
Figure 1: Possible orders, consistent: (1)+(2), inconsistent: (3)+(4).