Subtraction of Unsigned Numbers-2



Rating - 3/5
470 views

Since we are dealing with unsigned numbers, there is really no way to get an unsigned result for the second example. When working with paper and pencil, we recognize that the answer must be changed to a signed negative number. When subtracting with complements, the negative answer is recognized by the absence of the end carry and the complemented result.

Subtraction with complements is done with binary numbers in a similar manner using the same procedure outlined above. Using the two binary numbers X = 1010100 and Y = 1000011, we perform the subtraction X - Y and Y - X using 2's complemenfs:

                                X= 1010100

2' s complement of Y = +0111101

                          Sum = 10010001

These Topics Are Also In Your Syllabus
1 operation code link
2 Stored Program Organization link
You May Find Something Very Interesting Here. link
3 Instruction Codes link
4 Indirect Address link
5 Computer Registers link

Discard end carry 27 = - 10000000

           Answer: X - Y = 0010001

                               y = 1000011

 2's complement of X = +0101 100

                          Sum = 1101111

These Topics Are Also In Your Syllabus
1 STA: Store AC & BUN: Branch Unconditionally link
2 BSA: Branch and Save Return Address link
You May Find Something Very Interesting Here. link
3 BSA: Branch and Save Return Address -subroutine call link
4 ISZ: Increment and Skip if Zero & Control Flowchart link
5 Input-Output and Interrupt link

There is no end carry

Answer is negative 0010001 = 2's complement of 1101111


Rating - 3/5
487 views

Advertisements
Rating - 3/5