Answered step by step
Verified Expert Solution
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:
this value is called the minuend
this value is called the subtrahend
this value is called the difference
Working from right to left, we subtract and get We then subtract we get ; so we need to do a borrow, which makes it so the answer is with a borrow of We then subtract the borrow to get The result is therefore
What is really going on in the computer's memory is a little different. These digits are really stored as their ASCII codes:
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 Consider the subtraction of from ascii from ascii :
In other words, we're subtracting but we're also adding to that The result we want is which is but if we just subtract the two digits, we'll get because we subtracted out the 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 to the result ; 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started