Consider the following narrative to answer the questions The floating-point form
ID: 3907609 • Letter: C
Question
Consider the following narrative to answer the questions
The floating-point format to be used in this problem is an 8-bit IEEE 754 normalized format with 1 sign bit, 3 exponent bits, and 4 mantissa bits. It is identical to the 32-bit and 64-bit formats in terms of the meaning of fields and special encodings. The exponent field employs an Excess-3 coding (given below). The exponents 000 and 111 are reserved.
000 (reserved)
111 (reserved)
Which of the following is the encoding of the decimal value 3.5 into the above FLP format?
a. 01010000
b. 01001100
c. 01010101
d. Cannot encode
Decode 01010100 into its decimal value:
a. 2.5
b. 3
c. 5
d. -2
What is the difference between the largest and second largest numbers in this representation?
a. (1/24) * 23 = 0.5
b. (1/23) * 24 = 2
c. 23= 8
d. 24= 16
lw $8, 4($16)
sw $8, 0($16)
Consider the following code: Assume $16 has the starting address of an array A. Which of the following Java code describes this MIPS code?
a. A[8] = A[16]
b. A[0] = A[1]
c. A[1] = A[0]
d. A[A[16]+4] = A[8]
Explanation / Answer
Q1
The number is positive hence msb is 0
0 100 1100
This is = 2^(4-3)*1.75=3.5
Q2
01010100=2^(5-3)*1.25=5
Q3
The max value is 0 110 1111
The second max value is 0 101 1111
Difference will be
8*(1+0.5+0.25+0.125+0.0625)-4*(1+0.5+0.25+0.125+0.0625)=4*(1+0.5+0.25+0.125+0.0625)=7.75
Q4
lw $8, 4($16)
sw $8, 0($16)
This corresponds to A[0]=A[1]
lw $8, 4($16)
sw $8, 0($16)
This corresponds to A[0]=A[1]