Question: EE344 Digital Computer Systems Homework 3 Note: Read Chapter 4. Problem 1: What is the function of the program counter (PC) register? How many bits

 EE344 Digital Computer Systems Homework 3 Note: Read Chapter 4. Problem

EE344 Digital Computer Systems Homework 3 Note: Read Chapter 4. Problem 1: What is the function of the program counter (PC) register? How many bits of data should the PC hold? PC regutey io wred to hold hu noldrero of the Current unstruthoin being Estecuted Ftvbg.de. 8ronch addrtaRC 4hould hold 32 bita + Problem 2: Add comments to the following MIPS code. Assume that Sa0 and Sal are used for inputs and initially contain positive integers 6 and 10, respectively. Assume that SvO is used for output a. loop Sal, Szero, exit check if tal i,ua/fugz 1+0,wa..xd beq addi Sal, Sal,mdedbly ad- to Sal and soe in sa j loop exit exid program Problem 3: The code contains a violation of MIPS calling convention. Show the code with this mistake fixed function: sub Ss0, Sa0, Sa3 sll SvO, Ss0, 1 add SvO, Sa2, SvO sub SvO, SvO, Sal r Sra Problem 4: Convert the following C cod into MIPS code Use registers as x = SaO y-Sal, z-Sa2 and store the result into $s4. You must use the main program and function call. int short function(int x, int y, int z) int temp iffxc0) temp (y+z)-x else temp = x+y+z; return temp main0 ntx-2; int y-2; int z 1 int result, result = short-function(x,y,z)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!