Subtraction of Unsigned Numbers



Rating - 3/5
546 views

subtraction :

The direct method of subtraction taught in elementary schools uses the borrow concept. In this method we borrow a 1 from a higher significant position when the minuend digit is smaller than the corresponding subtrahend digit. This seems to be easiest when people perform subtraction with paper and pencil. When subtraction is implemented with digital hardware, this method is found to be less efficient than the method that uses complements.

The subtraction of two n-digit unsigned numbers M - N (N * 0) in base r can be done as follows:

1. Add the minuend M to the r's complement of the subtrahend N. This performs M + (r' - N) = M - N + r'.

2. If M "" N, the sum will produce an end carry r' which is discarded, and what is left is the result M - N.

These Topics Are Also In Your Syllabus
1 Design of Basic Computer link
2 Control Logic Gates link
You May Find Something Very Interesting Here. link
3 Control of Registers and Memory link
4 Control of Single Flip-flops link
5 Control of Common Bus link

3. If M < N, the sum does not produce an end carry and is equal to r' - (N - M), which is the r's complement of (N - M). To obtain the answer in a familiar form, take the r' s complement of the sum and place a negative sign in front.

Consider, for example, the subtraction 72532 - 13250 = 59282. The lO's complement of 13250 is 86750. Therefore:

                               M = 72532

lO's complement of N = +86750

                          Sum = 159282

These Topics Are Also In Your Syllabus
1 Fetch and Decode link
2 Determine the Type of Instruction link
You May Find Something Very Interesting Here. link
3 Register-Reference Instructions link
4 Memory-Reference Instructions link
5 AND to AC link

Discard end carry 10' = -100000

                      Answer = 59282

Now consider an example with M < N. The subtraction 13250 - 72532 produces negative 59282. Using the procedure with complements, we have

                                M = 13250 

lO's complement of N = +27468

These Topics Are Also In Your Syllabus
1 Program Counter link
2 Common Bus System link
You May Find Something Very Interesting Here. link
3 Common Bus System-memory address link
4 Computer Instructions link
5 Instruction Set Completeness link

                           Sum = 40718

There is no end carry.

Answer is negative 59282 = 10's complement of 40718


Rating - 3/5
538 views

Advertisements
Rating - 3/5