IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Can someone give the abridged description of "endian"?
For the guy who never took CS101. I know it's big-endian vs little-endian, and that it has something to do with the way the CPU processes instructions. Or at least I think I know that. If this would take a chapter to explain, then just tell me not to worry my pretty little head about it, and leave the hard stuff to real geeks.
===

Purveyor of Doc Hope's [link|http://DocHope.com|fresh-baked dog biscuits and pet treats].
[link|http://DocHope.com|http://DocHope.com]
New Big Endian is the proper form.
Little Endian sux. [link|http://en.wikipedia.org/wiki/Big_endian|Endianess on wikipedia].
New Thanks to all
Now I see why the code wouldn't port without help. But I still have one question. WTF would anyone prefer little-endian? I mean damn, that just don't make no sense nohow.
===

Purveyor of Doc Hope's [link|http://DocHope.com|fresh-baked dog biscuits and pet treats].
[link|http://DocHope.com|http://DocHope.com]
New Things were expensive back in those days.
Remember that CPUs and RAM were expensive early on.

Blame it on the 4004 and the 650x. [link|http://www.cpushack.net/CPU/cpu1.html|Linky]:

The 650x was little endian (lower address byte could be added to an index register while higher byte was fetched) and had a completely different instruction set from the big endian 6800. Apple designer Steve Wozniak described it as the first chip you could get for less than a hundred dollars (actually a quarter of the 6800 price) - it became the CPU of choice for many early home computers (8 bit Commodore and Atari products).

Unlike the 8080 and its kind, the 6502 (and 6800) had very few registers. It was an 8 bit processor, with 16 bit address bus. Inside was one 8 bit data register, two 8 bit index registers, and an 8 bit stack pointer (stack was preset from address 256 ($100 hex) to 511 ($1FF)). It used these index and stack registers effectively, with more addressing modes, including a fast zero-page mode that accessed memory addresses from address 0 to 255 ($FF) with an 8-bit address that speeded operations (it didn't have to fetch a second byte for the address).

Back when the 6502 was introduced, RAM was actually faster than microprocessors, so it made sense to optimize for RAM access rather than increase the number of registers on a chip. It also had a lower gate count (and cost) than its competitors.


I don't know the details, but the choice of endian-ness probably had to do with the desire to keep the transistor count down and thus the price.

Cheers,
Scott.
New Very simple
Suppose that I want to represent 67305985 = 1 + 2*256 + 3*256^2 + 4*256^3. Do I store the bytes in the order 1-2-3-4 (little endian) or 4-3-2-1 (big endian)?

Either order will work perfectly well, with appropriate technical adjustments. But the detailed code for handling the one does not work for the other.

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)
New Big Endian is also known as Network Byte Order
So BE machines can simply dump memory to the wire, LE's have to convert at the network interface. Thus LE machines have a PITA architecture for network programming.



"Whenever you find you are on the side of the majority, it is time to pause and reflect"   --Mark Twain

"The significant problems we face cannot be solved at the same level of thinking we were at when we created them."   --Albert Einstein

"This is still a dangerous world. It's a world of madmen and uncertainty and potential mental losses."   --George W. Bush
New 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.
Expand Edited by ChrisR Oct. 12, 2005, 02:40:05 PM EDT
New 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]
New 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. :-)
New This makes my head spin...
[link|http://en.wikipedia.org/wiki/Roman_arithmetic|Roman Arithmetic].

Cheers,
Scott.
New 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]
New 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)
New 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!
New 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."
New 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!
New 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

Expand Edited by jb4 Oct. 17, 2005, 05:47:53 PM EDT
New 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]
New 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

New Explain - how does wrongwayaroundianism help in those cases?
New 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

New Critter's Wiki link is good.
If you've only every worked with one, then things will feel strange when you encounter the other.

My first assembly experience was with 8085 and Z80 processors, which are little-endian (i.e. they put the LSB of a two-byte value at the lower location in memory). It always felt a ltitle backwards to me. When I encountered the 9900, which is technically big-endian (it is actually a true 16-bit processor), everything felt a lot cleaner.

Wade.
d-_-b
New And vice versa for me. Long live big-endian!
Alex

The trouble with the world is that the stupid are cocksure and the intelligent are full of doubt. -- Bertrand Russell
New 16, 15, 14 vs 1, 2 ,3
"the reason people don't buy conspiracy theories is that they think conspiracy means everyone is on the same program. Thats not how it works. Everybody has a different program. They just all want the same guy dead. Socrates was a gadfly, but I bet he took time out to screw somebodies wife" Gus Vitelli

Any opinions expressed by me are mine alone, posted from my home computer, on my own time as a free american and do not reflect the opinions of any person or company that I have had professional relations with in the past 49 years. meep
questions, help? [link|mailto:pappas@catholic.org|email pappas at catholic.org]
New Also note the USAmerican date format, which is MIDDLE-Endian
Yup, that LRPDism is a quote of me complaining about that.


   [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]
New "Endian" is a who they offshoar IT wurk to.
________________
oop.ismad.com
     Can someone give the abridged description of "endian"? - (drewk) - (24)
         Big Endian is the proper form. - (ChrisR) - (2)
             Thanks to all - (drewk) - (1)
                 Things were expensive back in those days. - (Another Scott)
         Very simple - (ben_tilly) - (15)
             Big Endian is also known as Network Byte Order - (tuberculosis)
             Little endian uses hebrew right to left - (ChrisR) - (13)
                 No it doesn't, and that's the problem. - (CRConrad) - (12)
                     Agreed. But left wondering on Endianess of Roman Numerals - (ChrisR) - (3)
                         This makes my head spin... - (Another Scott) - (2)
                             Try it with an abacus - (drewk) - (1)
                                 Exactly - (ben_tilly)
                     On Foolish Conistency - (pwhysall)
                     It gets worse. - (static) - (1)
                         Hurrah for 4-bit words. -NT - (pwhysall)
                     OK Christian.... - (jb4) - (4)
                         Give CRC pause? - (drewk) - (1)
                             Selbstverstandlich! -NT - (jb4)
                         Explain - how does wrongwayaroundianism help in those cases? -NT - (CRConrad) - (1)
                             zum Beispiel - (jb4)
         Critter's Wiki link is good. - (static) - (1)
             And vice versa for me. Long live big-endian! -NT - (a6l6e6x)
         16, 15, 14 vs 1, 2 ,3 -NT - (boxley)
         Also note the USAmerican date format, which is MIDDLE-Endian - (CRConrad)
         "Endian" is a who they offshoar IT wurk to. -NT - (tablizer)

In conclusion, lithium in the water supply.
479 ms