1
answer
0
watching
122
views
10 Nov 2019
Use AVR Studio 5.0 ATmega32A!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! In the final part of the lab. you arc to create a program that contains a procedure that performs division. You will use a simple brute-force approach to compute the quotient and remainder. Since division is simply multiplication in reverse, we can take a brute- force approach to division that iteratively tries a number of quotients until it finds the correct one. In other words, consider the linear equation: y = q_* x + r Division, and in particular, integer division, corresponds to the case when we arc given values for y an x and want to determine q and r The value of y is our initial value, the dividend or numerator, and the value of x is the divisor or denominator, the value by which we will be dividing y. The result includes q. the quotient, and r. the remainder. We'll assume unsigned division for simplicity. In this case, the remainder, r. must (by definition), be less than the value of x, the divisor. Consequently, we can determine the quotient and remainder of division of y by x by taking x and iteratively testing it (multiplying it) by possible quotients, starting from 0. In other words, start with q = 0 and iterate through q = 0, 1, 2, 3, ... until we find the smallest q such that r Less-Than x, where r = y - (q_* x). Create an assembly program with a procedure that performs division of a 16-bit unsigned dividend by an 8-bit unsigned divisor. The result will be an 8-bit unsigned quotient and an 8-bit unsigned remainder. The procedure will need to receive (from the caller) the input values for the dividend and divisor, and return (to the caller) the quotient and remainder. Have the main body of your program contain a few calls (at least three) to your Division procedure, each called with different values for the dividend and divisor, to appropriately test your procedure.
Use AVR Studio 5.0 ATmega32A!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! In the final part of the lab. you arc to create a program that contains a procedure that performs division. You will use a simple brute-force approach to compute the quotient and remainder. Since division is simply multiplication in reverse, we can take a brute- force approach to division that iteratively tries a number of quotients until it finds the correct one. In other words, consider the linear equation: y = q_* x + r Division, and in particular, integer division, corresponds to the case when we arc given values for y an x and want to determine q and r The value of y is our initial value, the dividend or numerator, and the value of x is the divisor or denominator, the value by which we will be dividing y. The result includes q. the quotient, and r. the remainder. We'll assume unsigned division for simplicity. In this case, the remainder, r. must (by definition), be less than the value of x, the divisor. Consequently, we can determine the quotient and remainder of division of y by x by taking x and iteratively testing it (multiplying it) by possible quotients, starting from 0. In other words, start with q = 0 and iterate through q = 0, 1, 2, 3, ... until we find the smallest q such that r Less-Than x, where r = y - (q_* x). Create an assembly program with a procedure that performs division of a 16-bit unsigned dividend by an 8-bit unsigned divisor. The result will be an 8-bit unsigned quotient and an 8-bit unsigned remainder. The procedure will need to receive (from the caller) the input values for the dividend and divisor, and return (to the caller) the quotient and remainder. Have the main body of your program contain a few calls (at least three) to your Division procedure, each called with different values for the dividend and divisor, to appropriately test your procedure.
Collen VonLv2
18 Aug 2019