102k views
0 votes
Translate the assembly program into Hexadecimal machine code. Then represent the binary representation corresponding R, I, or J format according to the respective field partitions:

a. (20000010) NOR ( $t2, $s2, $s3 ) SW ( $t2, 4($s0))
b. (00100010) NOR (01011, 01010, 01100) (101011, 01010, 0000000000000100)
c. (101011, 01010, 0000000000000100) (20000010) NOR ( $t2, $s2, $s3)
d. (20000010) NOR ( $t2, $s2, $s3 ) (00100010) NOR (01011, 01010, 01100)

User ClaudioC
by
7.9k points

1 Answer

7 votes

Final answer:

To convert the assembly program into hexadecimal machine code, we need to understand the R, I, and J formats. R-type format is used for the NOR instruction and involves three registers, while I-type format is used for the SW instruction and involves a register and an immediate value.

Step-by-step explanation:

To convert the given assembly program into hexadecimal machine code, we need to understand the format of the instructions. The R-type format is used for the instruction NOR, which involves three registers. The I-type format is used for the instruction SW, which involves a register and an immediate value. The J-type format is not used in the given code.

Let's convert the given instructions into hexadecimal machine code:

  1. NOR ($t2, $s2, $s3): The opcode for NOR is 000000. $t2, $s2, and $s3 are registers, represented by their binary equivalents: $t2 (01010), $s2 (10010), and $s3 (10011). The function code for NOR is 100111, so the hexadecimal machine code is 000000 01010 10010 10011 100111.
  2. SW ($t2, 4($s0)): The opcode for SW is 101011. $t2 is a register, represented by its binary equivalent: $t2 (01010). 4 is the immediate value, represented by its binary equivalent: 0000000000000100. $s0 is a register, represented by its binary equivalent: $s0 (10000). So, the hexadecimal machine code is 101011 01010 10000 0000000000000100.
User BernzSed
by
7.8k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.