Question: TASK 2 [ 8 pts ] : Write a function sumSquare in RISC - V that, when given an integer n , returns the summation

TASK2[8pts]: Write a function sumSquare in RISC-V that, when given an integer n, returns the summation of all squared odd numbers smaller than or equal to n. If the input, n, is not positive, the function returns 0. That is: ()= or 2+(2)2+...+12,()=(1),2+(3)2+...+12. To code for this problem, you should implement sumSquare by calling the function of square from task1 as a subroutine. The program must be compiled by Venus. To print your results, please call ecall. Save your program as task2.s

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 Programming Questions!