architecture - Endian-ness: Bits in a Byte vs. Bytes in Memory -
when specific architecture either little-endian or big-endian, referring whether numerical significance stored left-to-right or right-to-left in memory. question is: ordering refer how bits or ordered in byte, or how bytes ordered in memory?
for example, consider number 6000=1770h=0001011101110000b
. if both bits in byte , byte in memory little-endian, stored as
00001110 11101000 = 0e e8,
if bits in byte big-endian, bytes in memory little-endian, stored (for it's worth, happens how visual studio seems telling me memory organized in x64 architecture)
01110000 00010111 = 70 17,
if bits little-endian, bytes big-endian, stored as
11101000 00001110 = 0e e8,
and finally, if bits big-endian, bytes little-endian, stored as
00010111 01110000 = 17 70
(hopefully did right.)
so then, terms "little-endian" , "big-endian" refer to? terms refer ordering of bits in byte, or ordering of bytes in memory, or both? furthermore, if vs tells me that, example, 7c
, 'in' given particular byte, mean bits make byte in computer memory literally 0111 1100
, or mean value stored in byte 7ch=124
, or may not represented 7c=01111100
depending on whether or not underlying architecture happens little-endian?
the ordering of bits in byte invisible. since can't address individual bits, there no difference between 2 cases. however, can address individual bytes, there make difference.
if we're expressing 6000 in byte-addressible memory, high byte 23 decimal (6000 divided 256) , low byte 112 decimal (6000 mod 256). store 23,112 or 112,23. there no other options. ordering of bytes open choice, , endianness refers to.