The question is : show how the following hex values would be stored by 32 bit machines using big and little endian. Assume each address starts at 1016. I've filled in both address blanks, that part seemed easy enough.

Hex value: 456789A1

Big Endian
Address: 45 67 89 A1
Memory content: __ __ __ __

Little Endian
Address: A1 89 67 45
Memory content: __ __ __ __

I'm not sure what 1016 is and how that'll relate to the memory content.
Posted on 2008-10-22 04:54:27 by angrynapkin
You're confused.

The hex value belongs in the memory content fields.

To figure out the addresses, first extend the address - 00001016
Now you can easily solve this :)
Posted on 2008-10-22 07:09:05 by Homer
Addresses don't change between two endianesses. An address is an address. The problem of endianess is related to storing and reading more than 1 byte at a time by machines with registers larger than 8 bits.

If one of the machine's registers holds "3a4b5500" value in it, then it can be stored in memory as:
- 00 55 4b 3a (little endian, a.k.a Intel, least significant byte first, used mostly on PC-like machines)
- 3a 4b 55 00 (big endian, a.k.a Motorola, most significant byte first, used mostly on embedded machines)

But in both cases the address of the first byte written (either 00 or 3a) will be the same (for example: 1016 or 00001016 if you like).
Posted on 2008-10-22 10:22:51 by ti_mo_n

Yes I should have been more specific, I guess.
Memory addresses are just linear numbers - but the format in which data words in general (and notably POINTERS to addresses within binary programs) are stored IN MEMORY will vary according to which endianness is being used by the machine.

Posted on 2008-10-23 23:25:42 by Homer