Breaking News

What is Hexadecimal Numbers?

Hexadecimal numbers (base 16) can be added using the same method. The difference is that there are more digits in hexadecimal than there are in decimal. For example, in decimal, adding 5 and 7 results in 2 with a carry to the next highest position. In hexadecimal, however, 5 added to 7 does not go beyond the range of a single digit. In this case, 5 + 7 = C16 with no carry. It isn’t until a result greater than F16 is reached (a decimal 1510) that a carry is necessary.
In decimal, if the result of an addition is greater than 9, subtract 1010 to get the result for the current column and add a carry to the next column. In binary, when a result is greater than 1, subtract 102 (i.e., 210) to get the result for the current column then add a carry to the next column. In hexadecimal addition, if the result is greater than F16 (1510) subtract 1016 (1610) to get the result for the current column and add a carry to the next column.
D16 + 516 = 1310 + 510 = 1810
By moving a carry to the next highest column, we change the result for the current column by subtracting 1610.
1810 = 210 + 1610 = 216 with a carry to the next column
Therefore, D16 added to 516 equals 216 with a carry to the next column. Just like decimal and binary, the addition of two hexadecimal digits never generates a carry greater than 1. The following shows how adding the largest hexadecimal digit, F16, to itself along with a carry from the previous column still does not require a carry larger than 1 to the next highest column.
F16 + F16 +1 = 1510 + 1510 + 1 = 3110 = 1510 + 1610 = F16 with a 1 carry to the next column
When learning hexadecimal addition, it might help to have a table showing the hexadecimal and decimal equivalents such as that shown in Table below. This way, the addition can be done in decimal, the base with which most people are familiar, and then the result can be converted back to hex.
Hex Dec
016 010
116 110
216 210
316 310
416 10
516 510
616 610
716 710
816 810
916 910
A16 1010
B16 11101
C16 1210
D16 1310
E16 1410
F16 1510
Example
Add 3DA3216 to 4292F16.
Solution
Just like in binary and decimal, place one of the numbers to be added on top of the other so that the columns line up.
3 D A 3 2
+ 4 2 9 2 F
Adding 216 to F16 goes beyond the limit of digits hexadecimal can represent. It is equivalent to 210 + 1510 which equals 1710, a value greater than 1610. Therefore, we need to subtract 1016 (1610) giving us a result of 1 with a carry into the next position.
1
3 D A 3 2
+ 4 2 9 2 F
————-
1
For the next column, the 161 position, we have 1 + 3 + 2 which equals 6. This result is less than 1610, so there is no carry to the next column.
1
3 D A 3 2
+ 4 2 9 2 F
———–
6 1
The 162 position has A16 + 916 which in decimal is equivalent to 1010+ 910 = 1910. Since this is greater than 1610, we must subtract 1610 to get the result for the 162 column and add a carry in the 163 column.
1 1
3 D A 3 2
+ 4 2 9 2 F
—————-
3 6 1
For the 163 column, we have 116 + D16 + 216 which is equivalent to 110 + 1310 + 210 = 1610. This gives us a zero for the result in the 163 column with a carry.
1 1 1
3 D A 3 2
+ 4 2 9 2 F
————-
0 3 6 1
Last of all, 1 + 3 + 4 = 8 which is the same in both decimal and hexadecimal, so the result is 3DA3216 + 4292F16 = 8036116:
1 1 1
3 D A 3 2
+ 4 2 9 2 F 8
—————
0 3 6 1

Check Also

Cache RAM

Cache RAM Even with increases in hard drive performance, it will never be practical to …