C Board  

Go Back   C Board > Community Boards > Tech Board

Reply
 
LinkBack Thread Tools Display Modes
Old 05-01-2008, 10:21 AM   #1
Registered User
 
Join Date: Oct 2006
Location: UK/Norway
Posts: 469
Question about endians

Hallo,

I was wondering what is the advantage of the different endian systems? To me it looks like small end big endians would have the same advantages/disadvantages, while middle endians would just make things more complicated?

From what I have found out hand held consoles tend to favor the little endia system, while bigger systems are big endians.

But does it really make a difference how memory is stored?

Thanks
h3ro is offline   Reply With Quote
Old 05-01-2008, 10:29 AM   #2
Kernel hacker
 
Join Date: Jul 2007
Location: Farncombe, Surrey, England
Posts: 15,686
It is probably more of a coincidence (as in handheld systems prefer ARM or MIPS, bigger systems prefer X86) than anything else.

In the old days, the benefit of a little endian system was that a 16-bit update (for example increment or decrement) could potentially be made by writing the low byte only, and skipping the high byte - assuming you have a 8-bit bus, that is. On a 16-bit bus, you could perhaps do a 32-bit update by only updating the low half too.

These sort of benefits are no longer interesting, since these type of updates go to cache in 99.99% of all cases (and 100% of performance critical updates).

So, it's just a choice made by the processor designers these days.

--
Mats
__________________
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
matsp is offline   Reply With Quote
Old 05-01-2008, 10:33 AM   #3
(?<!re)tired
 
Mario F.'s Avatar
 
Join Date: May 2006
Location: Portugal
Posts: 5,650
And probably based only on historical reasons or backwards compatibility issues with code that makes specific use of endianness.
__________________
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.


Mario F. is online now   Reply With Quote
Old 05-01-2008, 10:33 AM   #4
Registered User
 
Join Date: Oct 2006
Location: UK/Norway
Posts: 469
Is the difference between the two something programmers have to think about, or is it all done by the compiler?

How can I convert between small and big? Found a few code examples of how to do it, but now `mathematical formula`
h3ro is offline   Reply With Quote
Old 05-01-2008, 10:35 AM   #5
(?<!re)tired
 
Mario F.'s Avatar
 
Join Date: May 2006
Location: Portugal
Posts: 5,650
You will have to worry about endianness if you are programming low level data communications between different systems, for instance, where you don't know or expect endianness to be different among them (this is basically anything network related these days). Or using libraries that warn you about their lack of support for endianness.

As for converting, information is all over the web.
__________________
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.


Mario F. is online now   Reply With Quote
Old 05-01-2008, 11:17 AM   #6
Registered User
 
Join Date: Oct 2001
Posts: 2,110
Just to clarify, x86 uses little endian.
robwhit is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Alice.... Lurker General Discussions 16 06-20-2005 02:51 PM
Debugging question o_0 C Programming 9 10-10-2004 05:51 PM
Question about pointers #2 maxhavoc C++ Programming 28 06-21-2004 12:52 PM
Question... TechWins A Brief History of Cprogramming.com 16 07-28-2003 09:47 PM
Question, question! oskilian A Brief History of Cprogramming.com 5 12-24-2001 01:47 AM


All times are GMT -6. The time now is 10:59 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22