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:1 | ISBN:9780763704445 | Edition: 3

Question

1. Assume you have a machine that uses 32-bit integers and you are storing the hex value 1234 at address 0:

a) Show how this is stored on a big endian machine.

b) Show how this is stored on a little endian machine.

c) If you wanted to increase the hex value to 123456, which byte assignment would be more efficient, big or little endian? Explain your answer.

TextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbook

Answer

a) The hex value 1234 at address 0 will store on big endian machine are shown in below diagram

        

b) The hex value 1234 at address 0 will store on little endian machine are shown in below diagram

           

c)

Little endian is more efficient because the additional information simply needs to be appended. With big endian, the "12" and "34" would need to shift to maintain the correct byte ordering.

0 0

Discussions

Post the discussion to improve the above solution.