Question: Problem: Division Procedure ( Atmel studio 7 in assembly langauge ) You are to create a program that contains a procedure that performs division. You
Problem: Division Procedure Atmel studio in assembly langauge
You are to create a program that contains a procedure that performs division. You will use a simple bruteforce 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 are
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 In other words, start with q
and iterate through q until we find the smallest q such that r x
where r y q x
Create an assembly program with a procedure that performs division of a bit unsigned dividend by an bit unsigned divisor. The result will be an bit unsigned quotient and an 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.
Bonus : Question: For each of the calls to your Division procedure, how many cycles did it take to compute the quotient and remainder?
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
