Page 41 - ComputerScience_Class_11
P. 41
Example 1: (6A7F) - (F63) 16
16
Answer: 6A7F and F63 have 4 and 3 digits. +1 +1 +1
6 A 7 F
Adding leading 0 to subtrahend, we get 0F63. + F (15) 0 9 C
15’s complement of 0F63 is F09C. 1 5 B 1 B
1
Adding 6A7F and F09C, we get 15B1B
5 B 1 C
(5B1C) 16
Example 2: (8AB.57) - (B7.8) 16 +1 +1 +1
16
Answer: 15’s complement of 0B7.80 is F48.7F 8 A B . 5 7
+ F 4 8 . 7 F
Adding 8AB.57 and F48.7F we get 17F3.D6 1 7 F 3 . D 6
(7F3.D7) 16 1
7 F 3 . D 7
Example 3: (F62) - (4A83) 16
16
Answer: 15’s complement of 4A83 is B57C.
+1
Adding F62 and B57C, we get C4DE. F 6 2
15’s complement of C4DE is 3B21. + B 5 7 C
Add -ve sign, we get C 4 D E
(-3B21) 16
Example 4: (4C.7) - (92D.8) 16
16
Answer: 15’s complement of 92D.8 is 6D2.7. +1
4 C . 7
Adding 4C.7 and 6D2.7, we get 71E.E.
+ 6 D 2 . 7
15’s complement of 71E.E is 8E1.1. 7 1 E . E
Add -ve sign, we get
(-8E1.1) 16
Hexadecimal Subtraction by 16’s Complement Method
16’s complement of a number is obtained by adding 1 to 15’s complement. For example, the 15’s complement of A2B3
is 5D4C. Its 16’s complement is 5D4C + 1 = 5D4D
The steps to be followed are:
1. Make the number of digits in the subtrahend equal to minuend by adding leading 0’s in the integer part of the
subtrahend and trailing 0’s in the decimal part if required.
2. Find the 16’s complement of the subtrahend.
3. Add this result to the minuend.
4. Discard the left most carry (MSB) to get the answer (when minuend > subtrahend).
5. Find 16’s complement of the sum and assign 1 as sign bit in MSB or -ve sign as answer (when minuend < subtrahend).
Example 1: (2E6F) - (B78) 16
16
Answer: Represent subtrahend as 0B78 to make it 4 digit number. +1 +1 +1
2 E 6 F
15’s complement of 0B78 is F487.
+ F 4 8 8
16’s complement of F487 is F488. 1 2 2 F 7
System of Numeration 39

