Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Database Programming

Authors: Chris Fehily

1st Edition

1937842312, 978-1937842314

More Books

Students also viewed these Databases questions

Question

5. Benchmark current training practices.

Answered: 1 week ago