lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Hash: SHA1

On 15/01/10 15:56, Klaus Ripke wrote:
> It has nothing to do with endianess in computer systems,
> it's related to the big endiannes of our hindu-arabic decimal system.
> Most significant digit left (= big end first for those reading left
> to right) is how we write numbers in any positional system like hex
> and thus we also write four as 100 in binary
> and left shift gives 1000 = eight.

IBM got this wrong with their POWER architecture, which eventually
evolved into PowerPC: the processor was big-endian, and they numbered
their bits in memory order, not in MSB-LSB order. This meant that in all
their manuals bit 0 was the MSB and bit 31 was the LSB... with the
utterly hilarious side effect that all the bit numbers changed if you
switched the processor from 32 bit mode to 64 bit mode.

Naturally, this made wiring up a POWER device to a more traditionally
labelled device an exercise in frustration. Eventually I started seeing
devices where the schematics had a logical unit on the bus between the
processor and the rest of the computer whose *sole* purpose was to
renumber all the lines from 31-0 to 0-31. (It had no actual physical
existence.) Even then, trying to do anything in machine code was
soul-destroying as every single bitfield notation in the manuals
required laborious conversion before you could understand them.

These days left *always* means in-the-direction-of-MSB, and right
*always* means in-the-direction-of-LSB, and suggesting otherwise can be
physically quite hazardous if you do so around engineers with PowerPC

- -- 
┌─── ───── ─────
│ "Money is a sign of poverty." --- Iain Banks
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla -