Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Let's do an example: 4 7 5 ( this value is called the minuend ) - 2 8 3 ( this value is called the

Let's do an example:
475(this value is called the minuend)
-283(this value is called the subtrahend)
----
192(this value is called the difference)
Working from right to left, we subtract 5-3 and get 2. We then subtract 7-8 we get -1; so we need to do a borrow, which makes it 17-8 so the answer is 9, with a borrow of 1. We then subtract [4-1(the borrow)]-2 to get 1. The result is therefore 192.
What is really going on in the computer's memory is a little different. These digits are really stored as their ASCII codes:
525553
-505651
----------
495750
This answer is computed almost exactly as described above, but one additional step is required because the numbers used are not equal to the digits they represent: they are larger by 48. Consider the subtraction of 51 from 53(ascii '3' from ascii '5'):
53-51(48+5)-(48+3)
In other words, we're subtracting 5-3, but we're also adding to that 48-48. The result we want is 50, which is (48+2), but if we just subtract the two digits, we'll get 2 because we subtracted out the 48's; this is the ASCII code for the start of text (STX), which is clearly not what we want. The solution, of course, is to add 48 to the result (2+48=50); this is the extra step that is required in the algorithm. Create the mips code to do this example

Step by Step Solution

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

Pro SQL Server Wait Statistics

Authors: Enrico Van De Laar

1st Edition

1484211391, 9781484211397

Students also viewed these Databases questions

Question

Describe the disciplinary action process.

Answered: 1 week ago