I must write a routine for conversion between the 2 representations. But I\'m a bit confused. If I have an architecture with a memory with words of 32 bits and I must store the
Big-endian memory layout is most significant bytes first, whereas little-endian layout is least significant bytes first. Given the value 0xA15D23B1:
Memory address 0 1 2 3
Big-endian A1 5D 23 B1
Little-endian B1 23 5D A1
Note that big-endian memory layout does not change with respect to word size, but little-endian does. If you consider two short words (16 bit), 0xA15D and 0x23B1 stored contiguously:
Memory address 0 1 2 3
Big-endian A1 5D 23 B1
Little-endian 5D A1 B1 23