Re: __LITTLE_ENDIAN vs. __LITTLE_ENDIAN_BITFIELD

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: linux-os (Dick Johnson)
Date: Wednesday, October 10, 2007 - 5:05 am

On Tue, 9 Oct 2007, Krzysztof Halasa wrote:


There are several chips in which bit 0 is the MSB. For instance,
a National Instruments chip used to interface with a GPIB bus,
TNT--something.

Nevertheless, if I write 0x12 to an 8-bit read/write register,
I will read back 0x12, and if I write 0x1234 to an 16-bit
read/write register, I will read back 0x1234. Regardless
of any endian. So, even though the internal 'value' seem
by the chip might not actually be 0x1234, for bit-mapped
registers it doesn't care because you define the function
of each bit.

The only time one would care is if one was setting a
particular value to a divisor of a timer or something
that needed a particular binary value, rather than bits.
In many cases, the value isn't 'pure' anyway. It might
be in BCD or offset-binary or some other perversion
that requires manipulation anyway so, again it is
important --only to the extent the resulting "number"
seen by the chip needs to be correct.

It is instructive to note that RAM is just a bunch
of bits that are uniquely addressable. Often the CPU
can't address one individual bit, but the interface
hardware does and, in particular, modern RAM makes
sure that bits that are adjacent in words are never
adjacent in the physical devices. This is so that
ECC has a chance of working! A nuclear event that
might upset a bit will 'splash' across an area,
upsetting many bits. If they all belonged to the
same few words, the single-bit correction wouldn't
work. The idea in the architecture it to have
nuclear events cause single-bit errors only, so
the bits of a word are never adjacent in physical
space.


Cheers,
Dick Johnson
Penguin : Linux version 2.6.16.24 on an i686 machine (5592.59 BogoMips).
My book : http://www.AbominableFirebug.com/
_


****************************************************************
The information transmitted in this message is confidential and may be privileged.  Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited.  If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to DeliveryErrors@analogic.com - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
__LITTLE_ENDIAN vs. __LITTLE_ENDIAN_BITFIELD, Timur Tabi, (Fri Oct 5, 11:27 am)
Re: __LITTLE_ENDIAN vs. __LITTLE_ENDIAN_BITFIELD, Jan Engelhardt, (Fri Oct 5, 11:35 am)
Re: __LITTLE_ENDIAN vs. __LITTLE_ENDIAN_BITFIELD, Timur Tabi, (Fri Oct 5, 12:35 pm)
Re: __LITTLE_ENDIAN vs. __LITTLE_ENDIAN_BITFIELD, Jan Engelhardt, (Fri Oct 5, 12:43 pm)
Re: __LITTLE_ENDIAN vs. __LITTLE_ENDIAN_BITFIELD, Timur Tabi, (Fri Oct 5, 12:47 pm)
Re: __LITTLE_ENDIAN vs. __LITTLE_ENDIAN_BITFIELD, Andreas Schwab, (Fri Oct 5, 1:04 pm)
Re: __LITTLE_ENDIAN vs. __LITTLE_ENDIAN_BITFIELD, Timur Tabi, (Fri Oct 5, 1:07 pm)
Re: __LITTLE_ENDIAN vs. __LITTLE_ENDIAN_BITFIELD, linux-os (Dick Johnson), (Fri Oct 5, 1:34 pm)
Re: __LITTLE_ENDIAN vs. __LITTLE_ENDIAN_BITFIELD, Timur Tabi, (Fri Oct 5, 1:37 pm)
Re: __LITTLE_ENDIAN vs. __LITTLE_ENDIAN_BITFIELD, Anton Altaparmakov, (Fri Oct 5, 2:06 pm)
Re: __LITTLE_ENDIAN vs. __LITTLE_ENDIAN_BITFIELD, Timur Tabi, (Fri Oct 5, 2:10 pm)
Re: __LITTLE_ENDIAN vs. __LITTLE_ENDIAN_BITFIELD, Andreas Schwab, (Fri Oct 5, 2:17 pm)
Re: __LITTLE_ENDIAN vs. __LITTLE_ENDIAN_BITFIELD, Andreas Schwab, (Fri Oct 5, 2:29 pm)
Re: __LITTLE_ENDIAN vs. __LITTLE_ENDIAN_BITFIELD, Timur Tabi, (Fri Oct 5, 2:32 pm)
Re: __LITTLE_ENDIAN vs. __LITTLE_ENDIAN_BITFIELD, Andreas Schwab, (Fri Oct 5, 4:17 pm)
Re: __LITTLE_ENDIAN vs. __LITTLE_ENDIAN_BITFIELD, Benjamin Herrenschmidt, (Fri Oct 5, 4:27 pm)
Re: __LITTLE_ENDIAN vs. __LITTLE_ENDIAN_BITFIELD, Lennart Sorensen, (Tue Oct 9, 10:46 am)
Re: __LITTLE_ENDIAN vs. __LITTLE_ENDIAN_BITFIELD, Timur Tabi, (Tue Oct 9, 10:56 am)
Re: __LITTLE_ENDIAN vs. __LITTLE_ENDIAN_BITFIELD, Lennart Sorensen, (Tue Oct 9, 11:34 am)
Re: __LITTLE_ENDIAN vs. __LITTLE_ENDIAN_BITFIELD, Krzysztof Halasa, (Tue Oct 9, 11:50 am)
Re: __LITTLE_ENDIAN vs. __LITTLE_ENDIAN_BITFIELD, Timur Tabi, (Tue Oct 9, 11:57 am)
Re: __LITTLE_ENDIAN vs. __LITTLE_ENDIAN_BITFIELD, Jeremy Fitzhardinge, (Tue Oct 9, 12:11 pm)
Re: __LITTLE_ENDIAN vs. __LITTLE_ENDIAN_BITFIELD, Krzysztof Halasa, (Tue Oct 9, 12:37 pm)
Re: __LITTLE_ENDIAN vs. __LITTLE_ENDIAN_BITFIELD, Krzysztof Halasa, (Tue Oct 9, 12:39 pm)
Re: __LITTLE_ENDIAN vs. __LITTLE_ENDIAN_BITFIELD, Timur Tabi, (Tue Oct 9, 12:44 pm)
Re: __LITTLE_ENDIAN vs. __LITTLE_ENDIAN_BITFIELD, Jeremy Fitzhardinge, (Tue Oct 9, 2:40 pm)
Re: __LITTLE_ENDIAN vs. __LITTLE_ENDIAN_BITFIELD, Krzysztof Halasa, (Tue Oct 9, 3:11 pm)
Re: __LITTLE_ENDIAN vs. __LITTLE_ENDIAN_BITFIELD, Krzysztof Halasa, (Tue Oct 9, 3:34 pm)
Re: __LITTLE_ENDIAN vs. __LITTLE_ENDIAN_BITFIELD, linux-os (Dick Johnson), (Wed Oct 10, 5:05 am)