Question

What list the three branching operands in MIPS. Explain each.

What list the three branching operands in MIPS. Explain each.

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

When MIPS instructions are classified according to coding format, they fall into three categories: R-type, I-type, J-type.


Machine Language: R Format
------------------------------------

• Instructions, like registers and words of data, are also 32 bits long
– Example: add $t0, $s1, $s2
– registers have numbers, $t0=9, $s1=17, $s2=18

000000 10001 10010 01000 00000 100000
op rs rt rd shamt funct

R-Format Example:

• add $8,$9,$10

Translate the above instruction.Specifically: Look up “add” on green card. As you can see, “add” is R format.

Look up the R format and the opcode/funct values for add. Then, fill in the tables and the underline below.

0 9 10 8 0 32

Binary number per field representation (use the right # of bits!):

000000 01001 01010 01000 00000 100000

hex representation: __0x012A4020

Machine Language: I format

---> Consider the load-word and store-word instructions,

– What would the regularity principle have us do?

– New principle: Good design demands a compromise

---> Introduce a new type of instruction format

– I-type for data transfer instructions

– other format was R-type for register

Example: lw $t0, 32($s2)

35 18 9 32
op rs rt 16 bit number

I-Format Example:

MIPS Instruction: addi $8,$9,7 $8 is rt; $9 is rs.

This instruction adds 7 to the contents of $9 and stores it in $8.

Translate the instruction above to fill in the following tables:

Decimal number per field representation:

8 9 8 7

Binary number per field representation:

001000 01001 01000 0000000000000111

Hex representation:__0x21280007

Machine Language: J Format

---> Jump (j) , Jump and link (jal) instructions have two fields

– Opcode

– Address

---> Instruction should be 32 bits (Regularity principle)

– 6 bits for opcode

– 26 bits for address

op 26 bit address

MIPS Instruction Formats:

---> simple instructions all 32 bits wide

---> very structured, no unnecessary baggage

---> only three instruction formats

R

op rs rt rd shamt funct

I

op rs rt 16 bit number

J

op 26 bit address
Add a comment
Know the answer?
Add Answer to:
What list the three branching operands in MIPS. Explain each.
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
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