Number with resolution of 2 cm. Assume the variable integer is 32 bits and unsigned. Assume the variable integer is passed by value into a subroutine using Register R0. Calculate the cost = (1.5 dollars/cm) distance. The cost is represented as an unsigned decimal fixed-point number with resolution of $0.01. The function should return the variable integer representing cost in Register R0. For example, if the distance is 1.25 cm, the cost will be (1.5 dollars/cm) * 1.25 cm = $1.87 (or $1.88 depending on how you round).
a) Let I be the variable integer representing distance. Give an equation relating distance and I.
b) Let J be the variable integer representing cost. Give an equation relating cost and J.
c) Write the assembly subroutine that converts distance to cost. Start with the desired operation cost = (1.5 dollars/cm) * distance and then derive a function that can be used to calculate J from I. Optimize for speed, eliminate overflow, and minimize cropout. The input I is passed by value in R0, and the output J is returned by value in R0.