SHARE
SPREAD
HELP

The Tradition of Sharing

Help your friends and juniors by posting answers to the questions that you know. Also post questions that are not available.


To start with, Sr2Jr’s first step is to reduce the expenses related to education. To achieve this goal Sr2Jr organized the textbook’s question and answers. Sr2Jr is community based and need your support to fill the question and answers. The question and answers posted will be available free of cost to all.

 

#
Authors:
Linda Null ,julia Lobur
Chapter:
A Closer Look At Instruction Set Architectures
Exercise:
Exercises
Question:2 | ISBN:9780763704445 | Edition: 3

Question

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

TextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbook

Answer

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.
 


 

 

 

 

0 0

Discussions

Post the discussion to improve the above solution.