Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

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

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions

Question

Do you think dad jokes are played out?

Answered: 1 week ago