subject

Assume we have a "computing agent" that knows how to do one-digit subtraction where the first digit is at least as large as the second(i. e, we do not end up with a negative number). Thus, our computing agent can do such operations as 7-3=4, 9-1=8, and 5-5=0. It can also subtract a one- digit value from a two-digit value in the range 10-18 as long as the final result has only a single digit. This capability enables it to do such operations as 13-7=6, 10-2=8 and 18-9=9.Using these primitive capabilities, disign an algorithm to do decimal subtraction on two m-digit numbers, where m Image for Assume we have a computing agent that knows how to do one-digit subtraction where the first digit is at least 1.You will be given two unsigned whole numbers am-1 am-2 a0 and bm-1 bm-2 b0. Your algorithm must compute the value cm-1 cm-2 c0, the difference of these two values. (am-1 am-2 a0 )-(bm-1 bm-2 b0 ) = cm-1 cm-2 c0 You may assume that the top number ( am-1 am-2 a0 ) is greater than or equal to the bottom number (bm-1 bm-2 b0 ) so that the result is not a negative value. However, do not assume that each individual digit ai is greater than or equal to bi. If the digit on the bottom is larger than the digit on the top, then you must implement a borrowing scheme to allow the subtraction to continue. (Caution: it may have been easy to learn subtraction as a first grader, but it is devilishly difficult to tell a computer how to do it!)

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:50
Before you enter an intersection on a green light make sure
Answers: 2
question
Computers and Technology, 22.06.2019 03:00
Check my work the microprocessor is a(n) circuit, which is designed to process data based on a set of instructions. most desktop and laptop devices contain a microprocessor based on the standard. most tablets and smartphones contain processors based on technology. a microprocessor's circuitry is designed to perform a limited number of tasks contained in its set. during processing, an instruction is loaded into the processor's unit. data is loaded into registers in the processor's where arithmetic and logic operations are performed. microprocessor performance can be measured by its speed. other factors affecting overall processing performance include word size, cache size, and instruction set complexity. most digital devices contain only one microprocessor chip, but today's multi- processors contain circuitry that supports parallel processing. computers contain various kinds of memory. random memory is a special holding area for data, program instructions, and the system. it stores data on a temporary basis until the processor makes a data request. ram is different from disk storage because it is , which means that it can hold data only when the computer power is turned on. computers also contain read- memory, which is a type of non-volatile memory that provides a set of "hard-wired" instructions, called the loader, that a computer uses to boot up.
Answers: 3
question
Computers and Technology, 23.06.2019 01:30
Negative methods of behavior correction include all but this: sarcasm verbal abuse setting an example for proper behavior humiliation
Answers: 1
question
Computers and Technology, 23.06.2019 11:00
In the context of the box model, what is the difference between a margin and a padding? a. a padding lies outside a box border, while a margin lies inside it. b. a padding lies inside a box border, while a margin lies outside it. c. a padding can be adjusted independently, while a margin depends on the size of its box. d. a padding depends on the size of its box, while a margin can be adjusted independently.
Answers: 3
You know the right answer?
Assume we have a "computing agent" that knows how to do one-digit subtraction where the first digit...
Questions
question
Computers and Technology, 14.09.2019 14:10
question
Computers and Technology, 14.09.2019 14:10
question
Mathematics, 14.09.2019 14:10
Questions on the website: 13722360