Question

2. [2090] In the MIPS instruction set we discussed in class, explain each field except sa in the three different instruction formats. Give an example instruction for each format. 3 Instruction Formats: all 32 bits wide OP OP Op rs rt rd funct R format I format J format sa rs rt immediate ump target

0 0
Add a comment Improve this question Transcribed image text
Answer #1

R - format instruction :

OP - is the opcode or operation code , it is of 6 bits in size

rs - rs is the first source register operand , it is of 5 bits in size

rt - rt is the second source register operand , it is of 5 bits in size

rd - rd is the destination register operand , it is of 5 bits in size

funct - It is the function code, identifies the specific R-format instruction , it is of 6 bits in size

Example : Consider the instruction

     add $s0, $s1, $s2 

the register 16,17,18 are used.

Instruction:

add $s0, $s1, $s2    # add rd, rs, rt
machine code:

000000 10001 10010 10000 0000 100000
(op rs rt rd shamt funct)

I format instruction :

OP - Operation code of 6 bits in size

rs - register containing base address of 5 bits

rt - register of destination/source of 5 bits

Immediate - value or a offset of 16 bits

Example : Consider an instruction ,

 lw $t0, 32($s3)       (registers 8 and 19)
OP rs rt immediate
35 19 8 32
100011 10011 01000 0000000000100000

J- format instruction :

OP- operation code of 6 bits

jump target address - Address in the instruction 26 bits

Example :

Consider an instruction :

 j LOOP if loop is at address 1028 then 
OP Address
2 257
000010 00000000000000000100000001
Add a comment
Know the answer?
Add Answer to:
2. [2090] In the MIPS instruction set we discussed in class, explain each field except sa...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 4. Given below is the MIPS instruction set for the R and I format along with...

    4. Given below is the MIPS instruction set for the R and I format along with examples of some operations. The function and opcodes are given in hexadecimal system t (5 bits) funct (6 bits 20 Inst Format op (6 bits) rs (5 bits)rt (5 bits) 0 0 reg2 reg2 0 0 regl Su InstFormat op (6 bits rs (5 bits) addi regl regl re regl regl constant constant constant constant 23 2b constant InstFormat jump constant Table 1: MIPS...

  • I need help writing out the number (in decimal) for each field and the final bits representation ...

    I need help writing out the number (in decimal) for each field and the final bits representation in bits. I got 0x2021FFFF for addi, 0x10200001 for beq, and I am currently stuck on j. Please let me know if I got the first two right and explain how to do j. Thanks The program below is written using the MIPS instruction set. It is loaded into memory at address 0xF000000C (all instruction memory addresses are shown below F000000C loop: addi...

  • There is an example below Now that everything is working you can try the following exercises. To complete them you wi...

    There is an example below Now that everything is working you can try the following exercises. To complete them you will need to refer to the documentation in Appendix A The MiteASM Assembler and Appendix B The MiteFPGA Processor. Write an assembly language program for an over counter for a cricket umpire. This should 1. display a count on the 7-segment display. The count should increase by 1 when button 0 is pressed. It should reset to 0 when button...

  • Suppose we have a 32-bit MIPS processor, which includes a 2-way set associative data cache with...

    Suppose we have a 32-bit MIPS processor, which includes a 2-way set associative data cache with capacity 16384 bytes, 16 bytes block, and a least recently used (LRU) replacement policy. Assume that the cache is empty (all valid bits are 0) before the following code is executed. lw $t1, 0x1040($0) lw $t2, 0x2044($0) lw $t3, 0x3048($0) lw $t4, 0x1044($0) lw $t5, 0x504c($0) lw $t6, 0x3040($0) For each of the six assembly instructions above, state i) the set field value for...

  • Question 4: Single Cycle Datapath Control (15 points) We wish to add the hardware support for...

    Question 4: Single Cycle Datapath Control (15 points) We wish to add the hardware support for a special R-type instruction jlr Jump and Link Register) to the single-cycle datapath below. Though this is an R-type instruction, but it is a special one that has the opcode being 000001 (instead of 000000), so the control unit will be able to differentiate this jlr instruction from the other R-type instructions and generate a special set of controls for this instruction. Opcode rs...

  • 5 Exercises Now that everything is working you can try the following exercises. To complete them you will need to refer...

    5 Exercises Now that everything is working you can try the following exercises. To complete them you will need to refer to the documentation in Appendix A- The MiteASM Assembler and Appendix B - The MiteFPGA Processor. Write an assembly language program for an over counter for a cricket umpire. This should display a count on the 7-segment display. The count should increase by 1 when button 0 is 1. pressed. It should reset to 0 when button 1 is...

  • 20 pts] 2- Consider the internal structure of the pseudo-CPU discussed in class augmented with a...

    20 pts] 2- Consider the internal structure of the pseudo-CPU discussed in class augmented with a single-port register file (i.e., only one register value can be read at a time) containing 32 8-bit registers (RO-R31) and a Stack Pointer (SP). Suppose the pseudo-CPU can be used to implement the AVR instruction ICALL (Indirect Call to Subroutine) with the format shown below: 10001 10101 00001 10011 ICALL pushes the return address onto the stack and jumps to the 16-bit target address...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT