Question

Consider the following MIPS assembly instructions: andi $s0, $t1, 65 a) What will be the machine...

Consider the following MIPS assembly instructions:

andi $s0, $t1, 65

a) What will be the machine code for the assembler instruction? Justify the answer and state it in hexadecimal form.
b) In which building blocks in the processor are the pieces in the machine code for the assembler instruction above used?

Homework Answers

Answer #1

a) The given instruction is an I-Type instruction. We can convert this to machine code as follows:

opcode: 001100 (ANDI instruction)

rs: 01001 ($t1)

rt: 10000 ($s0)

immediate: 0000000001000001 (65)

Hence the Machine code is 00110001001100000000000001000001

Converting to hex we get, 0x31300041

b)

First the Opcode is used in the Control part of the processor to set the control signals for the instruction.

The rs and rt fields are used in the Register File to get and store the values respectively.

The immediate field is used in the ALU as an input to perform addition.

You can comment below the answer in case of any doubts and I will be happy to help.

Please give a thumbs up if the answer could be of help!

All the best!

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
This is a homework assignment for Computer Architecture and some question use MIPS Assembly language. 1.    ...
This is a homework assignment for Computer Architecture and some question use MIPS Assembly language. 1.     In the following MIPS assembly code, translate all the instructions to their corresponding machine code in hexadecimal format. This code is stored in the memory from address 0x1fff0000. Loop: sw $t1, 4($s0)        addi $t1, $t1, -1    sll $t1, $t1, 2        bne $t1, $s5, Exit    addi $s0, $s0, 4          j Loop Exit: … 2.     Find the MIPS...
Question 1. Answer the following questions on MIPS Instruction Set. a) Show the minimal sequence of...
Question 1. Answer the following questions on MIPS Instruction Set. a) Show the minimal sequence of MIPS instruction for the following pseudocode segment: A[3] = A[10] + B; Assume that B corresponds to register $t3 and the array A has a base address of 1000C41016 which is required to be loaded to register $t0 in your code. Provide comments for each line of your MIPS instruction. b) Assume that Loop starts at memory location 0xC010. Provide a) instruction format of...
(MIPS Assembly Language): Assume the following piece of MIPS code: label1: .text 0x4000fc lui $t0, 1022...
(MIPS Assembly Language): Assume the following piece of MIPS code: label1: .text 0x4000fc lui $t0, 1022 ori $t0, $t0, 2048 srl $t1, $t0, 18 sw $t0, 101($t1) slti $t2, $t1, 5 beq $t2, $0, label3 label2:... ... label3:... a) The code modifies a word in memory at the following address (circle one): (i) 1022 (ii) 101 (iii) 5 (iv) 10220000 (v) Other (provide your own answer): _________________ b) The following value is stored in memory (circle one): (i) 0x17 (ii)...
Consider the following MIPS code and a 5 stages processor as discussed in class, and assume...
Consider the following MIPS code and a 5 stages processor as discussed in class, and assume the loop executes 3 times: loop: lw r1,4(r7) lw r2,8(r7) lw r3,12(r7) add r1,r1, r3 sw r1,4(r7) bne r1,r2,loop addi r1,r1,42 c. Draw the execution diagram. (10 points) d. The CPI (cycles per instruction) is obtained by computing the ratio of total cycles to number of instructions. Compute the CPI for the for the pipeline on this code. (5 points)
Do the following problems. 1. Each of three barrels from a manufacturing line are classified as...
Do the following problems. 1. Each of three barrels from a manufacturing line are classified as either above (a) or below (b) the target weight. Provide the ordered sample space. 2. The heat on each of two soldered parts is measured and labeled as either low (l), medium (m), or high (h). State the number of elements in the ordered sample space. 3. Consider the set of Beatles songs with a primary writer as either Paul McCartney (P) or John...
READ THE CASE STUDY AND ANSWER THE FOLLOWING QUESTIONS 2nd CASE: An Unexplained Death A 65-year-old...
READ THE CASE STUDY AND ANSWER THE FOLLOWING QUESTIONS 2nd CASE: An Unexplained Death A 65-year-old man of Scandinavian descent was rushed to the Emergency Room of your local hospital after a family member discovered him unconscious in his home. The woman who dialed “911” told the dispatcher that the man, her brother, was the local librarian of the past 10 years and had no spouse or children. She reported that they had spoken the day before, and he had...
What tools could AA leaders have used to increase their awareness of internal and external issues?...
What tools could AA leaders have used to increase their awareness of internal and external issues? ???ALASKA AIRLINES: NAVIGATING CHANGE In the autumn of 2007, Alaska Airlines executives adjourned at the end of a long and stressful day in the midst of a multi-day strategic planning session. Most headed outside to relax, unwind and enjoy a bonfire on the shore of Semiahmoo Spit, outside the meeting venue in Blaine, a seaport town in northwest Washington state. Meanwhile, several members of...