assignment-5-assignments-for-students

pdf

School

University of Regina *

*We aren’t endorsed by this school

Course

201

Subject

Electrical Engineering

Date

Jan 9, 2024

Type

pdf

Pages

3

Uploaded by DrBook9814

Report
Studocu is not sponsored or endorsed by any college or university Assignment-5 - assignments for students Introduction to Digital Systems (University of Regina) Studocu is not sponsored or endorsed by any college or university Assignment-5 - assignments for students Introduction to Digital Systems (University of Regina) Downloaded by black pearl (bp6735254@gmail.com) lOMoARcPSD|21438098
CS 201-Assignment 5 Due Date: June 10, 2020 Submit to UR Courses . Be sure to follow all assignment expectations. Question 1 [Mark 8] Write a sequence of MIPS instructions to find the absolute value of the value in register $s0 and store it into register $t0. Assume you do not have access to multiplication instructions. Use as few instructions as possible. You do not have to assemble your code for this question, but you may do so to validate that it works. Question 2 [Mark 10] (a) Using the MIPS sheet provided, assemble (by hand) the following instructions in to 32-bit binary values, and provide the HEX equivalent encoding. Indicate, in your own words, what each instruction does. For the subu instruction only, indicate the value of all control points and show the flow of data on the MIPS datapath. subu $s3 $t9 $v1 sra $t7,$a3,2 You may use the simulator in the lab or https://www.eg.bucknell.edu/~csci320/mips_web/ to check your work, but keep in mind that you will not have the simulator or the website on the exam. (b) Choose an instruction from the MIPS sheet and assemble it by hand. make any necessary assumptions. (c) The following hex values represent MIPS instructions. Disassemble the hex value and indicate the complete instructions that they represent, including all parameters. Again, you may verify using software tools but you will not have access to these tools on the exam. 0x106BFFE4 0x0FEDCBA9 (d) Imagine that the hex instruction 0x106BFFE4 from part (c) was corrupted by a single bit. What is the most similar instruction and the most different instruction you can find based on changing one bit in the instruction. (e) Imagine that, in the course of an error, the hex instruction 0x0FEDCBA9 were accidentally interpreted as an RGB colour. What colour would be displayed? Imagine the instruction were accidentally interpreted as a set of 4 ASCII characters? What characters would be displayed? Downloaded by black pearl (bp6735254@gmail.com) lOMoARcPSD|21438098
Question 3 [Mark 12] Write a MIPS program to demonstrate the operation of the following switch statement. switch (S) { case 5: A = A + 1; break; case 25: A = A - 1; break; default: A = A * 2; break; } Implement and simulate your solution. Allocate .data locations for the variables S and A, and load these values into registers before performing the switch statement on the registers. Run your program several times with different values for these variables, to ensure that your program works as expected. Bonus marks if your program prompts the user for the values of S and A, and displays results of the computation to the user. Assignment deliverables: all files must have the indicated filenames (replace 200200000 with your student number): 1. Assignment file named “A5_200200000.docx” or “A5_200200000.pdf” containing your complete solution for all questions, including screenshots of your compiled code and output (just like in the lab) 2. Code file A5Q30000.s (using the last four digits of your student number) for question 3 Downloaded by black pearl (bp6735254@gmail.com) lOMoARcPSD|21438098
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help