EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

Endianness does not apply to byte

Started by karthikbg November 17, 2006
Hi,

I find that regardless of what the byte Endian order is, the bits
within
bytes are always in Big-Endian format.

For instance, 1 is always stored in a byte as 000000012 no matter what
platform.

But, this is in violation to the Endianness concept as little endian
internally a big-endian. (Bits within Bytes)

So, this implies that Big-Endian is the better concept and why did they
introduce this little-endian ?

Strange !!! :(

Thx in advans,
Karthik Balaguru

karthikbg wrote:
> Hi, > > I find that regardless of what the byte Endian order is, the bits > within > bytes are always in Big-Endian format. > > For instance, 1 is always stored in a byte as 000000012 no matter what > platform. > > But, this is in violation to the Endianness concept as little endian > internally a big-endian. (Bits within Bytes) > > So, this implies that Big-Endian is the better concept and why did they > introduce this little-endian ? > > Strange !!! :( > > Thx in advans, > Karthik Balaguru >
How can you tell the endianess of a byte if a byte is the smallest addressable unit of memory? I don't think you can. I think the endianess of the smallest unit of memory is unknowable to the processor. In fact the processor couldn't detect how the memory is wired for the smallest addressable unit, i.e. it can't tell if d0 is connected to d0 or d8 of the memory chip. Nor does it care. Fun to think about, though. ;-) -Rich
karthikbg wrote:

> I find that regardless of what the byte Endian order is, the bits > within bytes are always in Big-Endian format. > But, this is in violation to the Endianness concept as little endian > internally a big-endian. (Bits within Bytes)
No it is not. Instead of sitting in a Computer Science 101 lecture playing WiFi games with your friends and verbally masturbating onto Usenet, look up the definition of big-endian. "<data, architecture> A computer architecture in which, within a given multi-byte numeric representation, the most significant byte has the lowest address (the word is stored "big-end-first")."
"karthikbg" <karthik.balaguru@lntinfotech.com> writes:
> I find that regardless of what the byte Endian order is, the bits > within bytes are always in Big-Endian format.
Sorry, Data General and IBM mainframes have the MSB numbered '0'. And GCC also has a setting for whether bits are big or little endian; it determines which end of a byte bitfields are allocated at. I.e: struct { int i1:3; int i2:3; int i3:2; } foo; Which bits are for i1?
"karthikbg" <karthik.balaguru@lntinfotech.com> wrote in message 
news:1163759863.554265.81790@e3g2000cwe.googlegroups.com...
> Hi, > > So, this implies that Big-Endian is the better concept and why did they > introduce this little-endian ? > > Strange !!! :(
Little endian make perfect sense when you have a processor that can handle multiple variable sizes such as the 80386. On a 80386 you would declare your variable as Var DW 1234h,5678h And access it as mov al,Var ; byte size access or mov ax,Var ; word or mov eax,Var ; long word if it had have been big endian then the same code would be mov al,Var+3 mov ax,Var+2 mov eax,Var Yuk. So, little endian wins in my book. But then again, it's been a long time since I worked in assembler. I might have even mixed up processors above!! Mike.
larwe wrote:
> karthikbg wrote: > > > I find that regardless of what the byte Endian order is, the bits > > within bytes are always in Big-Endian format. > > But, this is in violation to the Endianness concept as little endian > > internally a big-endian. (Bits within Bytes) > > No it is not. Instead of sitting in a Computer Science 101 lecture > playing WiFi games with your friends and verbally masturbating onto > Usenet, look up the definition of big-endian. > > "<data, architecture> A computer architecture in which, > within a given multi-byte numeric representation, the most > significant byte has the lowest address (the word is stored > "big-end-first")."
But, Why bits of a byte are of Big-Endian type in little-endian ? Then, we could stick for Big-endian throughout all designs. Any specific reasons for the bits of a byte to be of big-endian format !!! Really Strange. Need clarifications regarding this. Thx in advans, Karthik Balaguru
DJ Delorie wrote:

> Sorry, Data General and IBM mainframes have the MSB numbered '0'.
PA-RISC also does this. What a pain in the ass it is, by the way. I worked with a chip that was essentially an i486 SoC where the 486 core was removed and replaced with a PA-RISC. All the CPU registers and bus lines were numbered in the MSB=right-hand convention. All the peripherals were numbered in the MSB=left-hand convention. Possibly the worst 32-bit micro I have ever used. However it doesn't alter the fact that "big-endian" vs "little-endian" is by definition a discussion of _byte_ order, not _bit_ order.
karthikbg wrote:
> > I find that regardless of what the byte Endian order is, the bits > within > bytes are always in Big-Endian format.
...
> So, this implies that Big-Endian is the better concept and why did they > introduce this little-endian ?
The only good-endian is a dead-endian!
larwe wrote:
> DJ Delorie wrote: > > > Sorry, Data General and IBM mainframes have the MSB numbered '0'. > > PA-RISC also does this. What a pain in the ass it is, by the way. I > worked with a chip that was essentially an i486 SoC where the 486 core > was removed and replaced with a PA-RISC. All the CPU registers and bus > lines were numbered in the MSB=right-hand convention. All the > peripherals were numbered in the MSB=left-hand convention. Possibly the > worst 32-bit micro I have ever used. > > However it doesn't alter the fact that "big-endian" vs "little-endian" > is by definition a discussion of _byte_ order, not _bit_ order.
It is really strange that Endiannes is not dependent on the Bit_Order but only on the Byte_order. Why, the Bit_Order has not been taken into consideration ?? Really strange. Any specific reasons for this ??? Eager to know about this. Thx in advans, Karthik Balaguru
On 2006-11-17, karthikbg <karthik.balaguru@lntinfotech.com> wrote:

>> "<data, architecture> A computer architecture in which, >> within a given multi-byte numeric representation, the most >> significant byte has the lowest address (the word is stored >> "big-end-first")." > > But, Why bits of a byte are of Big-Endian type in little-endian ?
They aren't. You can't address bits[1]. Therefore, talking about what order they're in is nonsensical.
> Then, we could stick for Big-endian throughout all designs. > Any specific reasons for the bits of a byte to be of > big-endian format !!! Really Strange. Need clarifications > regarding this.
I've no idea what you're talking about. Are you referring to the format that a byte is printed on your terminal? If you don't like that, print it differently. It's got nothing to do with "endianness". [1] There are some processors that can address bits within a register with certain instructions. All the ones I've see call the LSB bit "0". I've never seen such bit-addressing made visible in a high-level language -- except possibly PL/M-51 from Intel (I never actually wrote in PL/M-51, and have rather vague memories of it). The 8051 had a nifty feature where there was a block of memory that was bit-addressible. I don't remember if the bit addressing was big-endian or little-endian I have seen documentation (IBM?) where the register desriptions label the MSB of a register as bit 0, but I've not run into any hardware that works that way. -- Grant Edwards grante Yow! If our behavior is at strict, we do not need fun! visi.com

The 2024 Embedded Online Conference