1. If 110 b = 12 10 , what is b (in base 10)? a. 8 b. 4 c. 3 d. 2 1. Which of th
ID: 3904890 • Letter: 1
Question
1. If 110b= 1210, what is b (in base 10)?
a. 8
b. 4
c. 3
d. 2
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. Which of the following expression represents the 4-bit unsigned binary number 1110?
a. 0 * 2 0 + 1 * 2 1 + 1 * 2 2 + 1 * 2 3 = 14
b. 0 * 2 0 + 1 * 2 1 + 1 * 2 2 - 1 * 2 3 = - 2
c. 1 * 2 0 + 0 * 2 1 + 1 * 2 2 - 0 * 2 3 = 5
d. 1 * 2 0 + 1 * 2 1 + 1 * 2 2 + 0 * 2 3 = 7
3. Which of the following expression represents the 4-bit 2’s complement number 1110?
a. 0 * 2 0 + 1 * 2 1 + 1 * 2 2 + 1 * 2 3 = 14
b. 0 * 2 0 + 1 * 2 1 + 1 * 2 2 - 1 * 2 3 = - 2
c. 1 * 2 0 + 0 * 2 1 + 1 * 2 2 - 0 * 2 3 = 5
d. 1 * 2 0 + 1 * 2 1 + 1 * 2 2 + 0 * 2 3 = 7
4. 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
1. Which of the following statements is true?
a. After executing the second line of the above code, the contents of $16 will be incremented by 4
b. Only the first and third instructions will access the RAM.
c. All of the above instructions are I type instructions.
d. All of the above statement are true
2. Which of the following statements is NOT true?
a. After executing the third line of the above code the contents of $8 and $9 will be same.
b. The loop in the above code will not terminate
c. The above code is like a while loop (not like do-while loop) in high-level languages
d. The RTL description of above beq is: IF (R[8] == R[9] ) PC ß PC -12 ELSE PC ß PC + 4.
1. Consider the following QtSPIM screen shot.
[00400038] 0085082a slt $1, $4, $5 ; 13: bge $a0, $a1, ELSE
[0040003c] 10200002 beq $1, $0, 8 [ELSE-0x0040003c]
The MIPS machine codes of the slt (0085082a) and beq (10200002) instructions are shown in HEX format. Which of the following is true? [hint: op-code is first 6 bits and fn-code is last 6 bits]
a. SLT is R-type, because the first byte is 0x00 = 00000000; therefore, the op-code is 000000
b. The fn-code of SLT is 101010 = 42, because the last byte is 0x2a = 00101010
c. The op-code of beq is 000100 = 4, because the first byte is 0x10 = 00010000
d. All of the above are true
2. What is the RTL description of the instruction JAL sub? [the order is important; &sub stands for the address of the label sub]
a. R[ra] ß PC + 4 , PC ß &sub
b. PC ß &sub, R[ra] ß PC + 4
c. R[ra] = &sub, PC ß PC + 4
d. R [ra] ß PC , PC ß &sub
[00400038] 0085082a slt $1, $4, $5 ; 13: bge $a0, $a1, ELSE
[0040003c] 10200002 beq $1, $0, 8 [ELSE-0x0040003c]
Explanation / Answer
1. If 110b= 1210, what is b (in base 10)?
Answer : option c. 3
Because 110 in base 3 = 1 * 3^2 + 1 * 3^1 + 0 * 3^0 = 9 + 3 + 0 = 12
====================
2. Which of the following expression represents the 4-bit unsigned binary number 1110?
Answer option a. 0 * 2 0 + 1 * 2 1 + 1 * 2 2 + 1 * 2 3 = 14
1110 in binary is equivalent to 8 + 4 + 2 + 0 = 14 in decimal
========================
3. Which of the following expression represents the 4-bit 2’s complement number 1110?
answer : option b. 0 * 2 0 + 1 * 2 1 + 1 * 2 2 - 1 * 2 3 = - 2
Explanation
4-bit 2's complement number is 1110
2's complement = 1'complement + 1
So 1110 = 1101 + 1
So the 1's complement is 1101, so the actual binary number is complement of 1's complement = 0010
The binary number 0010 is 2 in decimal
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.