There's something I'm wondering about and I find it hard to find the answer.
Say you have a 16-bit number with decimal value:
In binary, this is, as a human would write it:
In Intel's little endian order this becomes:
These bits, when represented in RAM, caches, ..., are, I guess, physically stored next to each other.
The question is: in what order are these bits physically laid out on RAM, and in the CPU caches? Same question for 32-bit, 64-bit integers, and floating point numbers.
It could be any of the following (mirroring still matters, e.g. if two numbers are stored next to each other...):
E.g. say some archeolisist in the far future would uncover a piece of RAM that was in the freezer all that time and look at it in a microscope that can somehow show the bit values, in what order would he see the bits compared to the numbers they represent?
Just a philosophical thing I'm wondering, nothing more
EDIT: removed parts about "hard disk", after all there it's file format dependent. But in RAM it's not, I'm talking about C code using primitive types like shorts, longs, floats, etc...
Edited by Lode, 16 December 2012 - 02:08 PM.