Assignment 2 CAO Solution
Assignment 2 CAO Solution
3. What are the maximum and minimum numbers that can be represented in 1’s
complement using 8-bits:
a. +128 and -128
b. +127 and -127
c. +126 and -126
d. +128 and -126
Correct Answer: b
Detailed Solution: The maximum and minimum numbers that can be represented in
1’s complement using n-bits are +(2n-1 – 1) and -(2n-1 – 1), respectively. Hence, the
maximum and minimum numbers that can be represented in 1’s complement using 8-
bits are +127 and -127, respectively.
______________________________________________________________________________
5. The addressing mode that adds the displacement and the index register to get the
effective address of the operand is:
a. Indexed addressing
b. Base-Indexed addressing
c. Register Indirect addressing
d. Relative addressing
Correct Answer: a
Detailed Solution: The indexed addressing mode adds the displacement specified as
part of the instruction and the index register to get the effective address (EA) of the
operand.
______________________________________________________________________________
6. Register R1 and R2 contain values 100 and 1000 respectively in decimal, and the word
length of the processor is 32 bits. What will be the value of the effective address of the
memory operand for the instruction “STORE R3, 70(R1, R2)?”
a. 1132
b. 1170
c. 1100
d. 1202
Correct Answer: b
Detailed Solution: EA = [r1] + [R2] + Offset = 100 + 1000 + 70 = 1170
______________________________________________________________________________
Detailed Solution: The given instructions are instances of register addressing mode
where the operand is held in a register, and an instruction specifies the register
number.
______________________________________________________________________________
10. Which of the following is false in regards to the assembler directive of the MIPS32
assembly code?
a. .text – Specifies the user text segment
b. .space n – Reserve space for n non-sequential bytes in memory
c. .ascii str – Stores the specified string in memory in ASCII code
d. .globl gbl – Specifies that the symbol ‘gbl’ is global
Correct Answer: b
Detailed Solution: All statements are correct except (b) – the directive “.space n”
reserves space for n successive bytes in memory.
______________________________________________________________________________
************END*******