Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

3. Consider a 32-bit hexadecimal number stored in memory as follows: If the mach

ID: 3817625 • Letter: 3

Question

3. Consider a 32-bit hexadecimal number stored in memory as follows:

If the machine is big endian and uses 2's complement representation for integers, write the 32-bit integer number stored at address 100 (you may write the number in hex).

If the machine is big endian and the number is an IEEE single-precision floating point value, is the number positive or negative?

If the machine is big endian and the number is an IEEE single-precision floating point value, determine the decimal equivalent of the number stored at address 100 (you may leave your answer in scientific notation form, as a number times a power of two).

If the machine is little endian and uses 2's complement representation for integers, wirte the 32-bit integer number stored at address 100 (you may write the number in hex).

If the machine is little endian and the number is an IEEE single-precision floating-point value, is the number positive or negative?

If the machine is little endian and the number is an IEEE single-precision floating point value, determine the decimal equivalent of the number stored at address 100 (you may leave your answer in scientific notation form, as a number times a power of two).

Address Value 100 2A 101 C2 102 08 103 1B

Explanation / Answer

I hope you are familiar with the number system representation(little Endean & big Endean) and 2's compliment representation.

2A            C2            08            1B
0010 1010    1100 0010    0000 1000    0001 1011

1: We know that the msb in 2's compliment representation systems, the most significant bit (msb) is reserved as the SIGN bit. If we take a look at the binary representation, we find the msb is 0 which means the number is positive (0 means positive and 1 means negative nunmber). Also in the same representation, if number is positive, then the absolute value of the integer is equal to the first n-1 bits.
So in our case: the number is same as the number stored at the address 100, that is 2A C2 08 1B

2: If we take a look at the IEEE single-precision floating point representation, we can find that the first or msb bit is reserved for the SIGN bit. In this case, the sign bit is 0 which means this number in IEEE single-precision floating point representation also positive.

3: In the IEEE single-precision floating point representation, here are the bit arrangements:

First bit (index 31): SIGN bit
Index 30 to index 23: Exponent
Index 22 to 0 : Fraction

In our case:

First bit (index 31): 0
Index 30 to index 23: 01010101
Index 22 to 0 : 10000100000100000011011

when we convert the above number into the decimal representation, we get the number as: 85.4327451


4: When we represent number in the Little Endean, then the MSB is stored in the last.
1B 08 C2 2A
0001 1011 0000 1000 1100 0010 0010 1010

Here also since the most significant bit MSB zero, which means the number is positive. In this case the number is same as the absolute value of the n-1 most significant numbers.

Hence the number in Hexadecimal is : 1B 08 C2 2A

5: In the IEEE single-precision floating point representation, most significant bit (msb) represents the SIGN bit. Here as we can see, the msb is 0 (0001 1011....).
Zero MSB means the number is also positive.

6: As explained earlier, the representation of the given number will be as follows:

First bit(index 31): 0
Index 30 to index 23: 00110110
Index 22 to 0 : 00010001100001000101010

when we convert the above number into decimal representation, we get the number 54.573994.

Thank You

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote