Question

1. The MIPS instruction set includes several shift instructions. They include logical-shift-left (sll), logical-shift-right (

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

(a)Arithmetic left shift is same as Logical left shift
A Left Arithmetic Shift of one position moves each bit to the left by one. The vacant least significant bit (LSB) is filled with zero and the most significant bit (MSB) is discarded. It is identical to Left Logical Shift. Therefore ,there is not any Arithmetic left shift.

(b)sll $s1 , $s2 ,n //$s1 = $s2<<n

let $t0<-n
for (; $t0 > 0; $t0--)
{
$s2 = $s2 + $s2; // or $s2 = 2 * $s2}

using instructions in mips

loop:
   beq $t0 $zero EXIT //if $t0==0 branch to EXIT
   add $s2 $s2 $s2 //$s2 = 2 * $s2
   addi $t0 $t0 -1 //$t0 = $t0-1
   j Loop //jump to loop
EXIT:
   add $s1 $s2 $zero //$s1 = $s2<<n
  


Add a comment
Know the answer?
Add Answer to:
1. The MIPS instruction set includes several shift instructions. They include logical-shift-left ...
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
  • 1. Write a program in Assembly language using MIPS instruction set that reads two integer numbers...

    1. Write a program in Assembly language using MIPS instruction set that reads two integer numbers from the user named as start and end number and finds out all the prime numbers between start and end (including start and end). Your program should do the validation of both the numbers as follows: i. start number must be smaller or equal to the end number. ii. Both numbers must be positive. iii. The maximum value for the end number is 10000...

  • 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...

  • Write a complete MIPS assembly language program that implements the following pseudocode. program h2 define global...

    Write a complete MIPS assembly language program that implements the following pseudocode. program h2 define global integer variables w, x, y, z -- in the .data section function main() SysPrintStr("Enter an integer >= 0 for w? ") w ← SysReadInt() SysPrintStr("Enter an integer >= 0 for x? ") x ← SysReadInt() SysPrintStr("Enter an integer < 0 for y? ") y ← SysReadInt() z ← 16(w + x) - (3 × -y mod 7) SysPrintStr("z = ") SysPrintInt(z) SysExit() end function...

  • 1.) a.) Using the simplified instruction set shown for part b, write code for the following....

    1.) a.) Using the simplified instruction set shown for part b, write code for the following. Suppose memory locations 1400 to 1449 contain 16-bit words. Each word represents 2 ASCII characters. Write code to read in and write out these 100 characters. Left-side character from location 1400 should be first, right-side character from location 1400 should be second, and remaining characters follow in numeric order. Assume you have access to 4 registers: R1, R2, R3, R4. Each register holds one...

  • 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...

  • Group Project 1 The Micro-1 Processor Simulation <Micro-1 Computer> Here's the organization of a computer equipped...

    Group Project 1 The Micro-1 Processor Simulation <Micro-1 Computer> Here's the organization of a computer equipped with a Micro-1 processor Memory contains an array of integer cells: int cell[] = new int[CAP]; where CAP is the capacity of memory. Initially this is set to 256. Internally, the Micro-1 processor is equipped with eight 32-bit data/address registers and two 32 bit control registers: PC, the program counter, contains the address of the next instruction to execute. IR, the instruction register, contains...

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