Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

  

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.

Step by Step Solution

3.50 Rating (157 Votes )

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

Matlab An Introduction with Applications

Authors: Amos Gilat

5th edition

1118629868, 978-1118801802, 1118801806, 978-1118629864

More Books

Students also viewed these Computer Network questions

Question

Describe the location of the pancreas and the pancreatic duct.

Answered: 1 week ago