Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Endianness We have declared the variables: int x = 1 1 2 2 3 3 4 4 5 5 ; unsigned int ux = 3

Endianness
We have declared the variables:
int x=1122334455;
unsigned int ux =3141592653;
int arr[]={10,-10};
char* s =Endian!";
The variable x is stored at 0200, ux at 0204, arr at 0208, and s at 0210.
If our system is little-endian, what values would be stored on each byte?
You can write the hexadecimal representation of the value at each address.
(Hint: You might want to look up the ASCII-to-hex conversion table!)
\table[[0\times 200,0\times 201,0\times 202,0\times 203,0\times 204,0\times 205,0\times 206,0\times 207],[,,,,,,,],[0\times 208,0\times 209,0\times 20A,0\times 20B,0\times 20C,0\times 20D,0\times 20E,0\times 20F],[,,,,,,,],[0\times 210,0\times 211,0\times 212,0\times 213,0\times 214,0\times 215,0\times 216,0\times 217],[,,,,,,,]]
Now, what would these values be if our system were big-endian instead?
\table[[0\times 200,0\times 201,0\times 202,0\times 203,0\times 204,0\times 205,0\times 206,0\times 207],[,,,,,,,],[0\times 208,0\times 209,0\times 20A,0\times 20B,0\times 20C,0\times 20D,0\times 20E,0\times 20F],[,,,,,,,],[0\times 210,0\times 211,0\times 212,0\times 213,0\times 214,0\times 215,0\times 216,0\times 217],[,,,,,,,]]
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beyond Big Data Using Social MDM To Drive Deep Customer Insight

Authors: Martin Oberhofer, Eberhard Hechler

1st Edition

0133509796, 9780133509793

More Books

Students also viewed these Databases questions