In: Computer Science
(1 point) Using a diagram/table, please illustrate how the personal record “John Cool, 45, 1980” will be stored in big- and little-endian byte ordering. The personal record includes a name (string), age (integer), and year (integer). The length of a byte is 8, and the length of a word is 32 for the computer.
Solution for the problem is provided below, please comment if any doubts:
The big-endian format:
ox….0 |
J |
o |
h |
n |
ox….4 |
C |
o |
o |
|
0x….8 |
l |
45 |
19 |
80 |
0x….C |
The little-endian format:
ox….0 |
80 |
19 |
45 |
l |
ox….4 |
o |
o |
C |
|
0x….8 |
n |
h |
o |
J |
0x….C |