1. Which of the following number will represent a number X, where -8 ? X ? 7, in
ID: 3906314 • Letter: 1
Question
1. Which of the following number will represent a number X, where -8 ? X ? 7, in four bit 2’s compliment representation (hint: check -1 and 1)?
a. (X ? 0) ? X : (16 - X)
b. (X + 16) mod 16
c. (X ? 0) ? X : (invert X in binary format + 1)
d. all
2. When adding two n-bit 2’s complement numbers, overflow will not occur, if
a. Both operands have different sign bits
b. Both operands have same sign bits, and the sign bit of the result is also same
c. Carry-in bits to MSBs are same as the Carry-out bit from the MSB
d. All of the above
3.
[3 points] Calculate the average MIPS ratings for both machines. Which machine is faster (based on MIPS)?
Note that, 1 GHz = 10 9 Hz, and 1 million is 10 6
Instruction Class
Machine M1 – ML1
Machine M2 – ML2
Cycles/Instr Class
Frequency (%)
Cycles/Instr Class
Frequency (%)
LW
5
10
4
20
SW
4
20
4
10
Branch
3
10
3
20
Other I-type
1
20
2
10
R-type
1
30
1
30
J- type
1
10
1
10
BONUS-2 [3 points]: Which machine, M1 or M2, will spent more time on executing memory reference instructions? By how much (in nano seconds)?
4. [3 points] Decode the following 8-bit IEEE representation into their decimal value:
(1) 1 011 1000 (2) 0 100 0000
Instruction Class
Machine M1 – ML1
Machine M2 – ML2
Cycles/Instr Class
Frequency (%)
Cycles/Instr Class
Frequency (%)
LW
5
10
4
20
SW
4
20
4
10
Branch
3
10
3
20
Other I-type
1
20
2
10
R-type
1
30
1
30
J- type
1
10
1
10
Explanation / Answer
2. When adding two n-bit 2’s complement numbers, overflow will not occur, if
a. Both operands have different sign bits
b. Both operands have same sign bits, and the sign bit of the result is also same
c. Carry-in bits to MSBs are same as the Carry-out bit from the MSB
d. All of the above
Answer) d. All of the above
As both the operands have different sign bits thus overflow does not occur and also if Both operands have same sign bits, and the sign bit of the result is also same overflow does not occur. Carry-in bits to MSBs are same as the Carry-out bit from the MSB.
4. [3 points] Decode the following 8-bit IEEE representation into their decimal value:
(1)10111000 (2)01000000
Answer)
(1)10111000 - 184
(2)01000000 - 64
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.