Project 3 Pre Quiz

pdf

School

Arizona State University *

*We aren’t endorsed by this school

Course

230

Subject

Computer Science

Date

Dec 6, 2023

Type

pdf

Pages

21

Uploaded by MateWorld4934

Report
Question 1 0.1/0.1pts Which of the following will copy the contents of register t1 to register t0? 1 The load word (Iw) and store word (sw) instructions move values between a register and a memory location and will not copy a value from one register to another. The only instruction that can accomplish this is the pseudo-op, move. For more information on this topic you can review the following sections of the manual on pseudo-ops and data transfer operations: http://progressive-learning-platform.github.io/instructions.htmi#pseudo- operations & http://progressive-learning-platform.github.io/instructions.htmi#data-transfer- operations
Question 2 0/0.1pts What is the ASCII value of a space (') in hexadecimal? Correct Answer Please review the Lecture 5 - UART in the Video Lectures section. You may also find it helpful to look up an ASCII table online.
Question 3 0.1/0.1pts What is the ASCII value of a period (') in decimal? Please review the Lecture 5 - UART in the Video Lectures section. You may also find it helpful to look up an ASCII table online.
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
Question 4 0.4/04pts 65 In decimal, the ASCII encoding of an upper cas ASCIl encoding of a lower case ' is 97 In decimal, the ASCII encoding of an upper case Z'is %0 ASCIl encoding of a lower case 7 is | 122 Answer 1: 65 Answer 2: 97 Answer 3: 90 Answer 4: 122 and the and the
Questions 01/01me
Question 6 0.2/0.2pts Suppose $t4 contains the value, 33. Which value can $t5 contain so that $t0 has a value of 1 after the following instruction is executed? slt $to, 5t5, $t4 21
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
Question 7 0.1/0.1pts What does the following instruction do? push $t7 For more information on the push pseudo-op, as well as other PLP pseudo- ops, you can review the table in the PLP manual e that includes the equivalent instructions for most pseudo-ops. You may also want to review Lecture 6 - Modularity and Comparisons.
Question 8 0/0.6pts ] | Correct Answer Correct Answer ) | Correct Answer Correct Answer | Correct Answer | Correct Answer Suppose $sp contains 0x10FFFFFC, $t0 contains 128, and $t1 contains 256. Fill in what the values in the table will be after running the following lines of code. $t0 $t1 push push Address Value Ox10FFFFF8| 250 Ox10FFFFFC| 232 Answer 1: 250 256 0x100 0x00000100 Answer 2: 128 0x80 0x00000020
Question 9 0.1/0.1pts Suppose you want to make a nested function call (i.e. a call to a function from inside of another function) using a jal rather than a call for performance reasons. How would the push and pop pseudo-ops be proprely ordered along with the jal so that the previous return address isnit lost? push $ra jal nested_function label nop pop Sza Correct. It is important to remember that push saves a register onto the stack and pop restores a value from the top of the stack to a register. In order to preserve the return address it should be saved before jumping and restored after returning from the jump-andHlink.
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
Question 10 0/0.2pts Based on the information in the project description, before storing each letter in the array your program should convert allletters to... | Correct Answer lowercase uppercase
Question 11 0.1/0.1pts Based on the information in the project description, if the following two lines of code are added to the skeleton code for Project 3, what will the program do? 1i $a0, 0 call project3_print
Question 12 0.1/0.1pts Based on the information in the project description, if the following two lines of code are added to the skeleton code for Project 3, what will the program do? 1i sa0, 1 call project3_print The string, "Yes" will be displayed on the simulated UART's output.
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
Question 13 0.1/0.1pts If the base address of the array was 0x10000014, what would be the address of the element 2 (assume that the array is zero indexed, where element 0 is the first element in the array and each element is 1 word in size)? 0x1000001c
Question 14 0.1/0.1pts Which instruction would you use to read a value from an element in an array?
Question 15 0.25/0.25 pts Which instruction would you use to write a value to an element in an array? sw
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
Question 16 0.25/0.25 pts Which instruction would you use to copy the address of an array (allocated using the space assembler directive) into a register? Assume a label is placed immediately before the allocated space.
Question 17 0.1/0.1pts Which instruction would you use to interact with the UART command register? sw
Question 18 0.1/0.1pts Which instruction would you use to interact with the UART status register?
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
Question 19 0.1/0.1pts Which instruction would you use to interact with the UART receive buffer?
Question 20 0.3/0.3pts Fillin the memory addresses (in hexadecimal) of the following UART registers/buffers: Command Register: 0x_F0000000 Status Register: 0x F0000004 Recieve Buffer: 0x F0000008 Answer 1: 70000000 L Correct MSW!!‘ 0xf0000000 Answer 2: 10000004 L Correct Answer‘ 0xf0000004 Answer 3: Correct Answer 0xf0000008
Question 21 0.5/0.5pts | Correct Answer Please download the following attached PLP project file: Project 3 Pre Quiz Mystery Program.plp & This program has been partially converted into machine code so that its functionality cannot be easily identified by reading it. Your task is to use PLPTool's Watcher Window and CPU Memory Visualizer to see what the output of the program s for specific input. Please open the attached file in PLPTool and perform the following steps: 1. Modify the first line in the program so that the load immediate instruction sets $t0 to the value, 53 2. Enter simulation mode (the blue button with *>SIM" on it) 3. Open the watcher window (the button with a magnifying glass icon) 4. Add registers $t0 and $s2 to the watcher window 5. Run the program until $t0 is set to the value, 0 6. Open the CPU memory visualizer (from the menu bar: Simulation -> Tools -> Create a PLP CPU Memory Visualizer) 7. In the memory visualizer, set the base address to the value of $s2 seen in the watcher window and set the signed offset to 40. 8.0ne of the rows in the memory visualizer should have a green background color and a non-zero value. Convert the value seen in this green cell from hexadecimal to decimal What value does this green memory location contain in decimal? NOTE: You must convert this value from hexadecimal to decimal in order to receive credit. 105 105
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