Sunday, October 21, 2012

HEXADECIMAL NUMBER OPERATION

++++HEXADECIMAL ADDITION++++


  • Unlike decimal system (base 10) with 10 digits and also binary system (base 2) with two digits, hexadecimal system (base 16) has 16 digits for its operation.

DECIMAL
4-BIT BINARY
HEXADECIMAL
0
0000
0
1
0001
1
2
0010
2
3
0011
3
4
0100
4
5
0101
5
6
0110
6
7
0111
7
8
1000
8
9
1001
9
10
1010
A
11
1011
B
12
1100
C
13
1101
D
14
1110
E
15
1111
F
Comparison between decimal, binary, and hexadecimal system…
  • Note: for hexadecimal system, from number 10 start we represent with alphabet A until number 16 and alphabet F. Let do some exercise !!



5 816
+2 216
7 1016 <---- Final answer will write 7A base 16.

Column 1 : Like decimal system, 8+2=10..... BUT the 1 will not carry out.. It will stay...
Column 2 : Do 5+2=7.....
Column 3: Final step.... convert the number 10 into hexadecimal format... which is A.... DONE !!!



  • ::::::::::Another example which are more complicated:::::

D
F16
+
A
C16




1310+1010+110=2410
1510+1210=2710

2410-1610=810
2710-1610=1110

=816


1 will carry
1 will carry


  1. Column 1: F+C=15+12=27.... But remember in hexadecimal system, only have 16 digits.. So we need use 27-16=11. The number 11 in hexadecimal system,so no need subtract again. Once we subtract one time, we need carry 1.
  2. Column 2: We solve D+A+1 = 13+10+1 = 24. Once again 24 exceed 16 digits in hexadecimal system... So we use same method in column 1, and we will get 8 and 1 will be carry.
  3. Final step, we write the answer as 18B16...

----------HEXADECIMAL SUBTRACTION--------



  • For subraction, we need do more conversion in order to solve the question. We need to convert hexadecimal number into binary number, then we need find 2's complement. Convert back into hexadecimal number then number then add two number. NOT UNDERSTAND ????!!! Come we do an example together.....
EX.......
8416-2A16


....1's compliment of 2A16 = 0101010
..... 2's compliment of 2A16 = 0101010+1---->11010110
......convert back into hexadecimal number ------> +D616
........Then add two number together, FOLLOW WHAT WE HAD DONE ABOVE, which we will get 15A16.... BUT we will drop the 1, cause the 1 represent negative in 2's compliment .
....... So final answer is 5A16.




Finally we have some links and video that maybe helpful to you all to understand more.

We also include some youtube video ..




No comments:

Post a Comment