Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 1: a) Consider a subroutine Line (xlist, ylist, n, slope, intercept) that accepts two list pointers and three values. The subroutine assumes that n
Question 1: a) Consider a subroutine Line (xlist, ylist, n, slope, intercept) that accepts two list pointers and three values. The subroutine assumes that n > 0, and that n is the number of word-sized elements in xlist. The subroutine also assumes that sufficient space for n word-sized elements has been reserved for ylist. The subroutine generates the y-coordinate for each x-coordinate for a point on a straight line given by y = slope * x + intercept, and hence each element from xlist is used to calculate a corresponding element in ylist. The subroutine also determines a count of how many calculated y-coordinate values are negative, and returns that count as a result to the calling code. Provide a pseudocode description of this subroutine. b) Provide an entirely modular implementation of the subroutine from Question 1 in Nios II assembly language. Follows the parameter-passing convention for register usage. Provide only the subroutine code. There should not be any directives or equates. Comments are not required. Question 1: a) Consider a subroutine Line (xlist, ylist, n, slope, intercept) that accepts two list pointers and three values. The subroutine assumes that n > 0, and that n is the number of word-sized elements in xlist. The subroutine also assumes that sufficient space for n word-sized elements has been reserved for ylist. The subroutine generates the y-coordinate for each x-coordinate for a point on a straight line given by y = slope * x + intercept, and hence each element from xlist is used to calculate a corresponding element in ylist. The subroutine also determines a count of how many calculated y-coordinate values are negative, and returns that count as a result to the calling code. Provide a pseudocode description of this subroutine. b) Provide an entirely modular implementation of the subroutine from Question 1 in Nios II assembly language. Follows the parameter-passing convention for register usage. Provide only the subroutine code. There should not be any directives or equates. Comments are not required
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started