In: Computer Science
Provide the following operations in four-digit 10's complement math. All input is in ten's complement. Provide the output in both ten's complement and decimal sign and magnitude formats.
a) 1818 + 9282 =
b) 1808 + 1188 =
c) 1929 - 1818 =
d) 2828 - 9988 =
Solution
c) 1929 - 1818 =
Steps
1. At first, find 10's complement of the B(subtrahend).
2. Then add it to the A(minuend).
3. If the final carry over of the sum is 1, then it is dropped and
the result is positive.
4. If there is no carry over, then 10's complement of the sum is
the final result and it is negative.
Here A = 1929, B = 1818.
Find A - B = ? using 10's complement
First find 10's complement of B = 1818
Note : 10's complement of a number is 1 added to it's 9's
complement number.
9's complement of 1818 is
9 | 9 | 9 | 9 | |
- | 1 | 8 | 1 | 8 |
8 | 1 | 8 | 1 |
Now add 1 : 8181 + 1=8182
Now Add this 10's complement of B to A
1 | 1 | 1 | 1 | |
1 | 9 | 2 | 9 | |
+ | 8 | 1 | 8 | 2 |
1 | 0 | 1 | 1 | 1 |
The left most bit of the result is called carry and it is
ignored.
So answer is 0111
0111 is the answer in 10s complement
(111)10 is the answer in decimal notation
---
d) 2828 - 9988 =
Before solution we need to understand the steps involved
1. At first, find 10's complement of the B(subtrahend).
2. Then add it to the A(minuend).
3. If the final carry over of the sum is 1, then it is dropped and
the result is positive.
4. If there is no carry over, then 10's complement of the sum is
the final result and it is negative.
Here A = 2828, B = 9988.
Find A - B = ? using 10's complement
First find 10's complement of B = 9988
Please note that 10s complement of a number is 1 added to it's 9's complement number.
9 | 9 | 9 | 9 | |
- | 9 | 9 | 8 | 8 |
0 | 0 | 1 | 1 |
Now add 1 : 0011 + 1=0012
Now Add this 10's complement of B to A
1 | ||||
2 | 8 | 2 | 8 | |
+ | 0 | 0 | 1 | 2 |
2 | 8 | 4 | 0 |
Here there is no carry, answer is - (10's complement of the sum
obtained 2840)
Note : 10's complement of a number is 1 added to it's 9's
complement number.
9's complement of 2840 is
9 | 9 | 9 | 9 | |
- | 2 | 8 | 4 | 0 |
7 | 1 | 5 | 9 |
Now add 1 : 7159 + 1=7160
So answer is -7160
in decimal
(-7160)10
---
i am good at 10s complement subtraction
thats why solved with detailed explanation
really sorry couldnt able to solve the 10s complement addition
all the best