Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3. (20%) Endianness. (1). (12%) Suppose you need to store 32-bit data 0x1001ABCD to the memory address 0x100. What is the hex value of each

3. (20%) Endianness.

(1). (12%) Suppose you need to store 32-bit data 0x1001ABCD to the memory address 0x100. What is the hex value of each memory byte on a little/big endian machine? Fill these values into the below table. Assume the word size of the computer is 32 bits. 0x100 0x101 0x102 0x103 Little endian Big endian

(2). (8%) The below C program checks the endianness for the underlying machine. What would be the output if it runs on a RISC-V computer? Explain your answer.

#include

int main()

{

int x = 1;

char* p = (char*)&x;

printf("%d ",(int)*p);

return 0;

}

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

More Books

Students also viewed these Databases questions