Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write MIPS instruction sequences to perform the following operations. Do not use pseudoinstructions. ( That means no LI , MOVE, etc. ) In addition to

Write MIPS instruction sequences to perform the following operations.
Do not use pseudoinstructions. (That means no LI, MOVE, etc.)
In addition to OR, ORI, AND, and ANDI, the MIPS ISA also has NOR (R-Type), XOR
(R-Type) and XORI (I-Type). Make the best use of all logical instructions.
Remember that I-type instructions are limited to the lower 16 bits (max 0xFFFF). Use
LUI if you need to load data into the upper 16 bits to make a 32-bit constant.
For full credit you must use a minimum length sequence.
For each operation, the input and output register is specified. Use the $t registers if
other registers are needed.
Express any constants in hex or binary (e.g.0x31C2 or 0b0011000111000010)
a) Extract byte 2(bits 16 to 23) of the value stored in $s0, placing it in the low order
byte (bits 0 to 7) of $s1. All other bits should be 0.(2 instructions)
b) Clear bits|12 to 15 of $s0 to 0(modify $s0 in place). Leave the other bits unmodified.
(3 instructions and use of a temporary register) Remember that logical instructions
(andi, ori, etc.) always extend the 16-bit immediate data with 0's.
c) Set bits 22 and 23 of $s0 to 1(modify $s0 in place). Leave the other bits unmodified.
(2 instructions and use of a temporary register)
d) Invert the even bits (bit 0,2,4,6,..30) of $ s0. Leave the odd bits unmodified. (3
instructions and use of a temporary register)
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems Third International Conference Achids 2011 Daegu Korea April 2011 Proceedings Part 2 Lnai 6592

Authors: Ngoc Thanh Nguyen ,Chong-Gun Kim ,Adam Janiak

2011th Edition

3642200419, 978-3642200410

More Books

Students also viewed these Databases questions

Question

8. Demonstrate aspects of assessing group performance

Answered: 1 week ago