The exercise is to write an assembly program to perform division as a repeated subtraction. The...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
The exercise is to write an assembly program to perform division as a repeated subtraction. The number format is 8-bit signed integer. Procedure: Division as repeated subtraction. Division can be expressed as: = Z + The term Z is the number of times that Y will "fit" into X and W/Y is the remainder. This can be done by repeated subtractions. 15 =? Where 15 is the dividend and 4 is the divisor. 4 15 – 4 = 11 One time 11 - 4 = 7 Two TImes 7- 4 = 3 Three times 3 – 4 = -1 0nly three times, remainder 3 This can be seen as: This will result in = 15 = 3 + = 3.75. The divisor "fits" into the dividend three times and there is a remainder of 3. Tasks: Load data from memory. The divisor and dividend will be loaded into registers (I will use registers "A" and "B" for dividend and divisor respectively, for this example) from memory. (.data) The processor will subtract the contents of A and B and increment a count by one if the difference is greater than or equal to zero. The difference will replace the contents of A. The above operation will be repeated until the difference is less than zero. The results of the division will be stored (as eight-bit signed integers) in two different memory locations (.data). The program must be able to handle all three cases X > Y,X = Y, X < Y by providing the correct output. The exercise is to write an assembly program to perform division as a repeated subtraction. The number format is 8-bit signed integer. Procedure: Division as repeated subtraction. Division can be expressed as: = Z + The term Z is the number of times that Y will "fit" into X and W/Y is the remainder. This can be done by repeated subtractions. 15 =? Where 15 is the dividend and 4 is the divisor. 4 15 – 4 = 11 One time 11 - 4 = 7 Two TImes 7- 4 = 3 Three times 3 – 4 = -1 0nly three times, remainder 3 This can be seen as: This will result in = 15 = 3 + = 3.75. The divisor "fits" into the dividend three times and there is a remainder of 3. Tasks: Load data from memory. The divisor and dividend will be loaded into registers (I will use registers "A" and "B" for dividend and divisor respectively, for this example) from memory. (.data) The processor will subtract the contents of A and B and increment a count by one if the difference is greater than or equal to zero. The difference will replace the contents of A. The above operation will be repeated until the difference is less than zero. The results of the division will be stored (as eight-bit signed integers) in two different memory locations (.data). The program must be able to handle all three cases X > Y,X = Y, X < Y by providing the correct output.
Expert Answer:
Related Book For
Posted Date:
Students also viewed these computer network questions
-
A binding greater than or equal to ( ) constraint in a minimization problem means that the minimum requirement for the constraint has just been met. another constraint is limiting the solution . the...
-
The exercise is to see how well you understand and can comply with the Guidelines on writing a Research Proposal that Knowledge, Management and Prognosis of Vitiligo among People Aged below 30 Years...
-
Your Assignment is to write an essay discussing how you, as a business owner, can use annuities to achieve business goals. Financial decisions require careful planning and prioritizing, especially...
-
On September 30 of the current year, Silver Fox Corporation files for bankruptcy. At the time, it estimates that the total FMV of its assets is $725,000, whereas the total amount of its outstanding...
-
The reality check 'Letters to SEC show support of global standards, according to Official' on pp.11-12 looks at issues associated with the United States convergence with IFRSs. What are the...
-
Math 110 Course Resources - Exponential & Logarithmic Functions Course Packet on logarithmic differentiation Use logarithmic differentiation to compute the derivative of y = = (x4 + 3)6(x-5) (x + 8)7
-
The following information is available for Banner Company: Calculate the following: a. 2019 debt-to-equity ratio. b. 2019 times-interest-earned ratio. c. 2019...
-
The following financial data were taken from the annual financial statements of Smith Corporation: Required a. Based on these data, calculate the following for 2008 and 2009: 1. Working capital 2....
-
There is only one copying machine in the student lounge of the business school. Students arrive at the rate of \ lambda = 4 0 per hour ( according to a Poisson distribution ) . Copying takes an...
-
No matter how a company measures the benefits provided by an online business implementation, it usually tries to measure those benefits in monetary units. In a paragraph or two, explain why this is a...
-
Interpreting the equity method footnote In its March 31, 2017, SEC Form 10-K, Lions Gate Entertainment Corp. (Lionsgate) reports unconsolidated equity method investments at $322.9 million on its...
-
At 6.75 percent interest, how long does it take to double your money? Note: Do not round intermediate calculations and round your answer to 2 decimal places, e.g., 32.16. Length of time years At 6.75...
-
Walmart Inc. has a $ 1 0 0 0 par value bond with exactly 1 4 years remaining to maturity. The next semi - annual coupon will be paid in 6 - months at a rate of 7 . 9 % APR compounded semi - annually....
-
Write a java program to print first 100 fibonacci numbers?
-
The following information is taken from Hafner Company's financial statements. Prepare the Operating Activities section of the Statement of Cash Flows for Hafner using the indirect method for the...
-
If the speed of sound is 3 4 , 5 0 0 cm / s and a note has a frequency of 2 5 6 Hz , what is the wavelength in meters?
-
Assume the CAPM holds. There are 3 investors, A , B , and C , and 3 stocks, X , Y , and Z . You observe that A: holds $ 2 0 0 0 of stock X and $ 4 0 0 0 of stock Y; B: holds $ 2 0 0 0 of stock Y and...
-
Based on the scenario described below, generate all possible association rules with values for confidence, support (for dependent), and lift. Submit your solutions in a Word document (name it...
-
Define two variables: alpha = /6, and beta= 3/8. Using these variables, show that the following trigonometric identity is correct by calculating the values of the left and right sides of the...
-
Use a single command to create a row vector (assign it to a variable named b) with 8 elements such that the last three element are 3.8 and the rest of the elements are 0s. Do not type the vector...
-
Defme the variables a, b, c, and d as: a = 12, b = 5.6, c = 3a/b2, and d = (ab)c/c, then evaluate: (a) a/b + dc/ d+c -(d-b)2 (b) dc/ea-2b + ln(cd + b/a)
-
The Phoenix Corporation reported a net loss but a positive cash flow from operations. Further, despite the net loss, the company continued to pay its regular dividend. Discuss why it is possible for...
-
Presented below is a list of income statement and balance sheet accounts: a. Interest expense b. Land c. Cost of goods sold d. Intangible assets e. Income tax expense f. Inventory g. Revenues h....
-
The Rankine Corporation reported net income of \($10\) million in 2016, and it appears that net income for 2017 will be the same. During 2017, the company made the following expenditures: 1....
Study smarter with the SolutionInn App