81.5k views
5 votes
Show how the value 0xabcdef12 would be arranged in memory of a little-endian and a big-endian machine. Assume the data is stored starting at address 0.

User Samah
by
4.6k points

1 Answer

6 votes

Answer and Explanation:

For the Big Endian

In a big endian format, the most significant byte is stored at the lowest address and the least significant byte is stored at the highest address. Therefore, the data given is stored as follows:

Address 0 | 1 | 2 | 3

Byte ab | cd | ef | 12

For the Little Endian

In a little endian format, the most significant byte is stored at the highest address (so the least significant byte is stored at the lowest address).

So, the data given would be stored as follows:

Address 0 | 1 | 2 |3

Byte 12 | ef | cd | ab

Hope this Helps!!!

User Melps
by
4.3k points