2. Show how the following values would be stored by machines with 32-bit words, using little endian and then big endian format. Assume each value starts at address 10 base16. Draw a diagram of memory for each, placing the appropriate values in the correct (and labeled) memory locations.
a) 456789A1 base16
b) 0000058A base16
c) 14148888 base16
a)
Storing the value 456789A1 base16 in little endian format:
Address: 10 11 12 13
---------------------------------------------
Value: A1 89 67 45
Storing the value 456789A1 base16 in big endian format:
Address: 10 11 12 13
--------------------------------------------
Value: 45 67 89 A1
b)
Storing the value 0000058A base16 in little endian format:
Address: 10 11 12 13
---------------------------------------------
Value: 8A 05 00 00
Storing the value 0000058A base16 in big endian format:
Address: 10 11 12 13
--------------------------------------------
Value: 00 00 05 8A
c)
Storing the value 14148888 base16 in little endian format:
Address: 10 11 12 13
---------------------------------------------
Value: 88 88 14 14
Storing the value 14148888 base16 in big endian format:
Address: 10 11 12 13
---------------------------------------------
Value: 14 14 88 88
In the diagrams, each memory location is labeled with its corresponding address. The values are stored in the memory locations according to the specified endianness: little endian has the least significant byte first, while big endian has the most significant byte first.