Question: Write a RISC - V function to count some of the values in an array. Your function should implement this interface: int array _ sum
Write a RISCV function to count some of the values in an array.
Your function should implement this interface:
int arraysumint array int count
all int values mean bit integers
array is the address of an array of bit integers, and
count is the number of entries in the array so the total memory
used by the array is times count
For each element in the array, you should call another function
that I provide:
int predicateint element It will return if you should skip the element and if you should
add it to the sum.
Pseudocode for this function might look something like:
int arraysumint array int count
sum
for i ; i count; i
if predicatearrayi
sum arrayi
return sum
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
