MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

COMPUTER ARCHITECTURE

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
MIPS instruction addi $s1, $s2, 100. can be simplified into
A
$s1 = $s2 + 100
B
$s1 = $s2 + 101
C
$s1 = $s2-100
D
$s1 = $s2 . 100
Explanation: 

Detailed explanation-1: -Add immediate, addi, is another common MIPS instruction that uses an immediate operand. addi adds the immediate specified in the instruction to a value in a register, as shown in Code Example 6.9.

Detailed explanation-2: -The ADDI instruction performs an addition on both the source register’s contents and the immediate data, and stores the result in the destination register. It’s syntax is: ADDI $destination register’s address, $source register’s address, immediate data.

Detailed explanation-3: -In MIPS there are only 3 ways to format instructions. They are the R-format (register), the I-format (immediate), and the J-format (jump).

Detailed explanation-4: -ADD Adds two registers and stores the result in a register. ADDI is an I-type instruction. This instruction allows you to add the contents of a register to an immediate value (a constant) and store the result in a register.

There is 1 question to complete.