Answered step by step
Verified Expert Solution
Question
1 Approved Answer
P1. Write a MIPS program using MARS IDE that a) Will assign the last 6 digits of your #900 number in hex format in a
P1. Write a MIPS program using MARS IDE that a) Will assign the last 6 digits of your #900 number in hex format in a variable N (2points) Example if your 900 number is 0x900123456 Last six digits - 123456 in decimal convert that to hex and store in a variable N b) Declare a hex number in variable M to mask bits from 2nd to 12th from value stored in N. (2 points) Then the 32-bit (0 to 31) variable will be storing as binary equivalent 00000000000000011110001001000000 Mask bits 2 to 12 - 00000000000000011110001001000000 After masking all bits other than the shaded ones will be o Which is 00000000000000000000001001000000 Decide the logical operation with a masking number to get the result as above. c) Shift the masked number so that 2nd bit is the oth (Least significant bit) bit. (2 points) d) Store the value in variable P. (2 points) Shift 2 time to right so you get 00000000000000000000000010010000 Store that in variable P. e) Compute (only compute you do not have to print the expression) the result of expression Q=(N-P) * 2, without using multiplication instruction and display the result. Display only the result in Q. (3 Points) f) Compute (only compute you do not have to print the expression) the result of expression Q= (N+P)/2, without using division instruction and display the result. Display only the result in Q. (3 Points) P1. Write a MIPS program using MARS IDE that a) Will assign the last 6 digits of your #900 number in hex format in a variable N (2points) Example if your 900 number is 0x900123456 Last six digits - 123456 in decimal convert that to hex and store in a variable N b) Declare a hex number in variable M to mask bits from 2nd to 12th from value stored in N. (2 points) Then the 32-bit (0 to 31) variable will be storing as binary equivalent 00000000000000011110001001000000 Mask bits 2 to 12 - 00000000000000011110001001000000 After masking all bits other than the shaded ones will be o Which is 00000000000000000000001001000000 Decide the logical operation with a masking number to get the result as above. c) Shift the masked number so that 2nd bit is the oth (Least significant bit) bit. (2 points) d) Store the value in variable P. (2 points) Shift 2 time to right so you get 00000000000000000000000010010000 Store that in variable P. e) Compute (only compute you do not have to print the expression) the result of expression Q=(N-P) * 2, without using multiplication instruction and display the result. Display only the result in Q. (3 Points) f) Compute (only compute you do not have to print the expression) the result of expression Q= (N+P)/2, without using division instruction and display the result. Display only the result in Q. (3 Points)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started