Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Task 1 : Conversion Program You will write a MIPS assembly program that mimics this C + + code which includes a function call: Given:

Task 1: Conversion Program
You will write a MIPS assembly program that mimics this C++ code which includes a
function call:
Given: main() does not have any variables in $ s registers. (meaning that for this assignment
you don't have to worry about saving and restoring registers).
A skeleton assembly program that you will complete to write your code is available to
you in the conv.asm file. Your solution MUST INCLUDE a well-designed function
call. Space for the input, filter, result and result length will all be in the skeleton code
in the .data section. For the sake of the autograder, do not include other mentions ofTask 1: Conversion Program
You will write a MIPS assembly program that mimics this C++ code which includes a function call:
void conv(int inp[], int filt[], int result[], int result_l){
int filt_size =3;
for(int i =0; i result_l; i++){
for (int j =0; j filt_size; j++){
Result[i]+= inp[i + j]* filt[j];
}
}
}
// you dont need to implement main, our main will call conv for you
// it is just included here so you can see how it is called
int main(){
int inp[5]={5,7,2,6,3};
int result_length =3;
int result[3]={0,0,0};
int filt[3]={1,0,-1}
conv(inp, filt, result, result_length);
// prints: 31-1
for(int i =0; i result_length; i++){
print(%d , result[i]);
}
return 0;
}
image text in transcribed

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

Database Management An Organizational Perspective

Authors: Richard T. Watson

1st Edition

0471305340, 978-0471305347

More Books

Students also viewed these Databases questions

Question

What ethical issues are involved in this case? (D10)

Answered: 1 week ago

Question

What were your most important educational experiences?

Answered: 1 week ago

Question

Which personal relationships influenced you the most?

Answered: 1 week ago