Post #229,327
10/12/05 2:38:31 PM
10/12/05 2:40:05 PM
|
Little endian uses hebrew right to left
1 + 2*256 + 3*256^2 + 4*256^3 Stated differently on a different number base: 1*10^0 + 2*10^1 + 3*10^2 + 4*10^3 - the number 4 thousands, 3 hundreds, 2 tens, and 1 one. Big endian is 4321. Little endian is 1234. Sure we could say that the mathematical notation of using big endian for numbers is purely a convention of higher powers on the left. But having settled on decimal (powers of ten) numbers in this fashion, I see no reason why we shouldn't standard on hexadecimal (powers of sixteen) and byte-decimal (powers of 256) in the the same fashion.
Edited by ChrisR
Oct. 12, 2005, 02:40:05 PM EDT
|
Post #229,433
10/13/05 6:38:38 AM
|
No it doesn't, and that's the problem.
Sure, that we write "four-thousand three-hundred and twenty-one" as '4321' in stead of '1234' could be said to be "just convention". But your example is misleading -- it's too simple to illustrate the *real* problem. Decimal numbers are made up out of decimal digits; it's just a two-level hierarchy -- whereas in the machine-encoding of numbers we're discussing here, the basic binary-digits (bits) form bytes (eight bits), and the actual whole number is then in turn formed out of those. That's a *three*-level hierarchy.
In order to really see how stupid "little-endianism" is, you have to illustrate it with a similar three-level hierarchy. Here's one such attempt, using the popular "thousands-grouping" of binary digits: Consider the number "one-hundred-and-twenty-three-million four-hundred-and-fifty-six-thousand seven-hundred-and-eighty-nine" -- as a simple bunch of digits, it would be '123456789'; this is also *basically* the same as the "big-endian" way of writing it. The "little-endian" version, though, would NOT be '987654321'!
"Little-endianism" means ordering the BYTES "backwards" -- but the BITS within those bytes are still in the original order! The analogue in decimal numbers would be to write our numbers with the digits arranged into groups, like so: "One-hundred-and-twenty-three-million four-hundred-and-fifty-six-thousand seven-hundred-and-eighty-nine" = '123,456,789'. This is the "big-endian" way of writing it; larger-value groups ("bytes") come before smaller-value ones, and *within* each group, larger-value digits ("bits") also come before smaller-value ones.
The "little-endian" variant of the same thing is this: "One-hundred-and-twenty-three-million four-hundred-and-fifty-six-thousand seven-hundred-and-eighty-nine" = '789,456,123'! As you can see at a glance, digits ("bits") which differ in order of magnitude by only one step are far from each other (7 and 6, 4 and 3), while adjacent ones represent wildly different magnitudes (9 and 4, 6 and 1). It's illogical, unreasonable, and confusing... because it's bloody *inconsistent*!
Now, some "open-minded thinkers" among us may want to decry my complaint as a "hobgoblin of small minds", yadda yadda, cha-cha-cha... But at least in this case, that's bullshit. Consistency is what keeps us sane in a crazy world, what allows us to make sense of and cope with what we see, and (more directly related to the subject at hand) what helps us get the job done without going crazy ourselves; it is a "hobgoblin" only to those who have something against one or all of those.
[link|mailto:MyUserId@MyISP.CountryCode|Christian R. Conrad] (I live in Finland, and my e-mail in-box is at the Saunalahti company.)
Your lies are of Microsoftian Scale and boring to boot. Your 'depression' may be the closest you ever come to recognizing truth: you have no 'inferiority complex', you are inferior - and something inside you recognizes this. - [link|http://z.iwethey.org/forums/render/content/show?contentid=71575|Ashton Brown]
|
Post #229,442
10/13/05 10:19:43 AM
|
Agreed. But left wondering on Endianess of Roman Numerals
Let's see: we've got I, II, III, IV, V, VI .... Romans couldn't seem to make up their minds. :-)
|
Post #229,443
10/13/05 10:40:37 AM
|
This makes my head spin...
[link|http://en.wikipedia.org/wiki/Roman_arithmetic|Roman Arithmetic].
Cheers, Scott.
|
Post #229,447
10/13/05 11:18:53 AM
|
Try it with an abacus
I finally understand Roman numerals. They were just a way to represent the abacus operations.
===
Purveyor of Doc Hope's [link|http://DocHope.com|fresh-baked dog biscuits and pet treats]. [link|http://DocHope.com|http://DocHope.com]
|
Post #229,462
10/13/05 12:28:31 PM
|
Exactly
It is well-documented that acceptance of Arabic notation and the decline of the abacus go hand in hand. The essential difference is that the abacus is faster, but doesn't lend itself to being checked as conveniently.
Cheers, Ben
I have come to believe that idealism without discipline is a quick road to disaster, while discipline without idealism is pointless. -- Aaron Ward (my brother)
|
Post #229,445
10/13/05 10:46:09 AM
|
On Foolish Conistency
I bet NASA wish they'd had some of that when they planted the Mars probe firmly into the Martian soil because they had rather too much cha-cha-cha and not enough foolish consistency...
Peter [link|http://www.no2id.net/|Don't Let The Terrorists Win] [link|http://www.kuro5hin.org|There is no K5 Cabal] [link|http://guildenstern.dyndns.org|Home] Use P2P for legitimate purposes!
|
Post #229,522
10/13/05 10:02:03 PM
|
It gets worse.
The 8085 - a little-endian processor - numbers the bits in the bytes 76543210. That is, bit 0 is 0x01. The 9900 - a big-endian processor - numbers the bits in the bytes 01234567. That is, bit 0 is 0x80.
Wade.
"Insert crowbar. Apply force."
|
Post #229,548
10/14/05 7:07:42 AM
|
Hurrah for 4-bit words.
Peter [link|http://www.no2id.net/|Don't Let The Terrorists Win] [link|http://www.kuro5hin.org|There is no K5 Cabal] [link|http://guildenstern.dyndns.org|Home] Use P2P for legitimate purposes!
|
Post #229,882
10/17/05 5:46:17 PM
10/17/05 5:47:53 PM
|
OK Christian....
...put a </rant> in your oh-so-self-righteous stream of consiousness, and consider two real-world scenarios: byte stream serialization of greater-than-bytewide values, and integer type conversions.
Got that? Good.
Now, do you want to moderate your rant just a little bit? (Of course you don't, and I wouldn't expect you to. However, just between you and no body else in particular, it does give you pause, doesn't it?)
jb4 shrub●bish (Am., from shrub + rubbish, after the derisive name for America's 43 president; 2003) n. 1. a form of nonsensical political doubletalk wherein the speaker attempts to defend the indefensible by lying, obfuscation, or otherwise misstating the facts; GIBBERISH. 2. any of a collection of utterances from America's putative 43rd president. cf. BULLSHIT
Edited by jb4
Oct. 17, 2005, 05:47:53 PM EDT
|
Post #229,891
10/17/05 8:01:51 PM
|
Give CRC pause?
The only way anyone's ever giving CRC paws is if they turn him into a dog.
(Read it out loud if you're not groaning yet.)
===
Purveyor of Doc Hope's [link|http://DocHope.com|fresh-baked dog biscuits and pet treats]. [link|http://DocHope.com|http://DocHope.com]
|
Post #229,893
10/17/05 8:05:11 PM
|
Selbstverstandlich!
jb4 shrub●bish (Am., from shrub + rubbish, after the derisive name for America's 43 president; 2003) n. 1. a form of nonsensical political doubletalk wherein the speaker attempts to defend the indefensible by lying, obfuscation, or otherwise misstating the facts; GIBBERISH. 2. any of a collection of utterances from America's putative 43rd president. cf. BULLSHIT
|
Post #229,923
10/18/05 7:47:14 AM
|
Explain - how does wrongwayaroundianism help in those cases?
|
Post #230,199
10/20/05 11:59:31 AM
|
zum Beispiel
little-endian: \nfor (size_t i = 0; i < sizeof(multibyte_thing); i++)\n{\n serialize(static_cast<uint8_t *>(&multibyte_thing) + i);\n}\n big_endian: \nfor (size_t i = 0; i < sizeof(multibyte_thing); i++)\n{\n uint8_t * lsb_ptr;\n\n lsb_ptr = static_cast<uint8_t>(&multibyte_thing) + (sizeof(multibyte_thing) - 1);\n serialize(lsb_ptr - i);\n}\n Any questions? (Yes, there are myriad other ways to do this...you shoulda seen my first attempt...or maybe not!)
jb4 shrub●bish (Am., from shrub + rubbish, after the derisive name for America's 43 president; 2003) n. 1. a form of nonsensical political doubletalk wherein the speaker attempts to defend the indefensible by lying, obfuscation, or otherwise misstating the facts; GIBBERISH. 2. any of a collection of utterances from America's putative 43rd president. cf. BULLSHIT
|