Maker Pro
Maker Pro

Interfacing between Little and Big endian

pavankukkala

Mar 25, 2014
78
Joined
Mar 25, 2014
Messages
78
Hi friends,
I have been to interview on last week.
They have asked me the question as
If your laptop is Little Endian and Microntroller is Big Endian, how to interface the communication between them.Can anybody solve this for me
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,889
Joined
Jun 21, 2012
Messages
4,889
Go look at some of the pages from this Google search. It refers to the byte order of byte-addressable random access memory when representing integers that require two or more bytes. The Wikipedia article gives a pretty clear explanation. You can blame the confusion on Intel who used the little endian approach in their microprocessors.
 

dorke

Jun 20, 2015
2,342
Joined
Jun 20, 2015
Messages
2,342
I find the Gulliver connection fascinating...
Didn't know that ,
although using the terminology for decades ...:rolleyes:

Etymology
Danny Cohen introduced use of the terms Little-Endian and Big-Endian for byte ordering in a well-known document in 1980. In this technical and political examination of byte ordering issues, the "endian" names were pointedly drawn from Jonathan Swift's 1726 satirical fantasy novel, Gulliver’s Travels, in which civil war erupts over whether the big or the small end of a soft-boiled egg is the proper end to crack open.
 

Amar Dhore

Dec 2, 2015
129
Joined
Dec 2, 2015
Messages
129
You can write a function to convert a little endian into a big endian or vice versa. So when you receive a data from laptop, convert it into the compatible endian.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
Go look at some of the pages from this Google search. It refers to the byte order of byte-addressable random access memory when representing integers that require two or more bytes. The Wikipedia article gives a pretty clear explanation. You can blame the confusion on Intel who used the little endian approach in their microprocessors.
Actually it goes back further than that. Digital was little endian and IBM was big endian before Intel existed.

BTW, I was the developer who prototyped this product, and made over 1,000,000 lines of customer code from PowerPC chips, which assumed big endian, run on Intel chips via recompilation:

https://software.intel.com/en-us/c-compilers/biendian

It allows you declare each individual data item as either big or little endian, and the compiler automatically handles all conversions for you.

Bob
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,889
Joined
Jun 21, 2012
Messages
4,889
Wow, Bob! Not being a programmer, I wasn't aware this compiler existed. Good job extending the life of apps written for the PowerPC to play nicely with the Gorilla in the room (Intel).

Actually it goes back further than that. Digital was little endian and IBM was big endian before Intel existed.
True. And DEC probably had an inferiority complex vis a vis IBM. Oh, DEC tried hard with the VAX series, but nobody makes commercially successful big-iron like IBM. BTW, IBM had its roots here in Dayton with NCR. Thomas J. Watson, chairman and CEO of IBM, received his management training under John Henry Patterson, the founder of NCR. I think Watson had the larger vision, but NCR did well (making cash registers) under Patterson, whose name is sprinkled like salt all over Dayton.

In the 1970s I had to make a choice between Intel and Motorola as to which architecture to follow. At that time I thought the architecture of the Motorola 68000 series was clearly superior to Intel's 80x86 series, but we were already invested in an Intel MDS (Microprocessor Development System) and intended to transition from TTL discrete logic design to embedded microprocessors. It would have been nice to follow both technology branches, but I didn't have the resources to do that.

I worked with DEC equipment in the 1980s and completely forgot about (or didn't notice) that little-endian thing, maybe because of my simultaneous involvement with Intel 8085 μPs. I still believe that Intel killed DEC and all the other minicomputer manufacturers, although IBM got the ball rolling with their Intel-based PCs. IIRC, almost all minicomputers in the 1960s and 1970s were constructed with discrete TTL logic and manufacturers (except for DEC and Sun and perhaps a few others) were slow to upgrade to integrated circuit CPUs. It was, after all, a niche market owned by nerds automating factories and performing data acquisition tasks. Not exactly a home or even business product until IBM and Apple came along, promising like a politician to put a computer in Everyman's house. But it sounds like you had been working more in the trenches during the "revolution" than I in my Ivory Tower and could have a better perspective. Anyway, the War is over and everyone has a computer of their own choice now.

Thank you @BobK for posting that bit of history and your role in resolving the big-endian versus little-endian problem for all those PowerPC users abandoned by Apple.
 
Top