This is my second article on hexadecimal arithmetic. In this article I will explain subtraction of hexadecimal numbers.
Key Questions:
- How to perform subtraction on hexadecimal number system or base 16 number system?
- How to perform fractional hexadecimal numbers subtraction?
- How to perform hexadecimal subtraction using 16’s complement
Hexadecimal
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
A
|
B
|
C
|
D
|
E
|
F
|
Decimal
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
12
|
13
|
14
|
15
|
Hexadecimal Subtraction Examples:
The hexadecimal numbers subtraction is same as subtraction perform in other number systems. The rules and principles are exactly same as we have learnt in primary classes. Keep in mind when working with Binary numbers you borrow 2. When working with octal you borrow 8. When working with hexadecimal numbers you borrow 16. You can varify your results using this online calculator. Let's get started.
Example#01:578)16-34A)16
6 16
5 7 8
-3 4 A
2 2 E
Units column subtraction: 8-A. This is not possible. You have to borrow from tens column. Borrow=16. 16+8-A=16+8-10=14)10=E)16
Column
|
Borrow
|
Decimal
|
Hexadecimal
|
Sum/remainder
|
Carry/quotient
| |
1st column
|
8-A
|
16
|
16+8-10
|
E
|
---
|
---
|
Answer:22E)16
Example#02:BD.AA)16-89.FC)16
16
C 9 16
B D . A A
-8 9 . F C
3 3 . A E
Borrow
|
Decimal
|
Hexadecimal
|
Sum/remainder
|
Carry/quotient
| ||
1st column
|
A-C
|
16
|
16+10-12
|
E
|
---
|
---
|
2nd column
|
9-F
|
16
|
16+9-F
|
A
|
---
|
---
|
Answer:33.AE)16
Hexadecimal Subtraction Using 16’s Complement:
This method is also applicable for condition when Minuend<Subtrahend. In this method we take complement of the subtrahend and then add it to minuend.
Minuend-Subtrahend=difference
Minuend + [complemented subtrahend] = difference
There are two conditions.
- Carry is produced, discard carry and you get the answer
- Carry is not produced, first take the 16’s complement of the answer (sum) and then assign negative sign to it. Then you get the right answer
Example#01:BD.AA)16-89.FC)16
Let's repeat the above example.
Complement subtrahend
15’s complement = 76.03)16
16’6 complement = 76.04)16
Add minuend and complemented subtrahend
1
B D . A A
+ 7 6 .0 4
1 3 3 . A E
Decimal
|
Hexadecimal
|
Sum/remainder
|
Carry/quotient
| |
D+6
|
13+6
|
19÷16
|
3
|
1
|
B+7+1
|
11+8
|
19÷16
|
3
|
1
|
Discard carry. 33.AE)16 is the right answer
Answer: 33.AE)16
Example#02:112.AB)16-FC2.CD)16
In this case Minuend<Subtrahend
Complement subtrahend
15’s complement = 3D.32)16
16’s complement = 3D.33)16
Add Minuend and 16’s complement of Subtrahend
1 1 2 . A B
+3 D . 3 3
1 4 F . D E
Carry is not produced. First take complement of the answer (sum) and assign negative sign to it
15’s complement = EB0.21)16
16’s complement = EB0.22)16
Assign negative sign = -EB0.22)16
Answer: - EB0.22)16
Note: I discussed all possible cases and rechecked all the answers. If you still fing any mathematical,logical or typographical mistake please inform me.
Recommended Books:
Recommended Books:
How you find 16's compliment of above problem
ReplyDeleteWould you like to tell me which problem?
DeleteTake 15's complement of subtrahend and add 1 at least significant Bit , then this is your 16's complement.
ReplyDeleteGood
ReplyDelete