Uncategories
Hexadecimal Number System
Hexadecimal Number System
What is Hexadecimal Number System?
- Hexadecimal System employs 16 as a base, requiring 16 distinct symbols 0 to 9 and A to F for its digits.
- Also known as base 16 numbers. The digits have a value specified which is equal to the base number ( 16 ) 0,1,2,3,4,5,6,7......n from right to left.
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 |
How to convert Hexadecimal to Binary?
- Each hexadecimal digit represents 4 binary digits (bits).
- convert each digit of the hexadecimal number to binary using the below table.
Hexadecimal: |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
A |
B |
C |
D |
E |
F |
Binary: |
0 |
1 |
10 |
11 |
100 |
101 |
110 |
111 |
1000 |
1001 |
1010 |
1011 |
1100 |
1101 |
1110 |
1111 |
Example:
- 1E3 = 0001 1110 0011
- 1F2 = 0001 1111 0010
- 1C1 = 0001 1100 0001
How to convert Hexadecimal to Decimal?
- Multiply each digit of the given number with the specified value.
- The specified value is 16index . The index starts from 0 and is incremented by 1 from right to left.
- Add the results.
Example:
Hex
base 16 |
Decimal
base 10 |
Calculation |
0 |
0 |
- |
1 |
1 |
- |
2 |
2 |
- |
3 |
3 |
- |
4 |
4 |
- |
5 |
5 |
- |
6 |
6 |
- |
7 |
7 |
- |
8 |
8 |
- |
9 |
9 |
- |
A |
10 |
- |
B |
11 |
- |
C |
12 |
- |
D |
13 |
- |
E |
14 |
- |
F |
15 |
- |
10 |
16 |
1×161+0×160 = 16 |
11 |
17 |
1×161+1×160 = 17 |
12 |
18 |
1×161+2×160 = 18 |
13 |
19 |
1×161+3×160 = 19 |
14 |
20 |
1×161+4×160 = 20 |
15 |
21 |
1×161+5×160 = 21 |
16 |
22 |
1×161+6×160 = 22 |
17 |
23 |
1×161+7×160 = 23 |
18 |
24 |
1×161+8×160 = 24 |
19 |
25 |
1×161+9×160 = 25 |
1A |
26 |
1×161+10×160 = 26 |
1B |
27 |
1×161+11×160 = 27 |
1C |
28 |
1×161+12×160 = 28 |
1D |
29 |
1×161+13×160 = 29 |
1E |
30 |
1×161+14×160 = 30 |
1F |
31 |
1×161+15×160 = 31 |
20 |
32 |
2×161+0×160 = 32 |
30 |
48 |
3×161+0×160 = 48 |
40 |
64 |
4×161+0×160 = 64 |
50 |
80 |
5×161+0×160 = 80 |
60 |
96 |
6×161+0×160 = 96 |
70 |
112 |
7×161+0×160 = 112 |
80 |
128 |
8×161+0×160 = 128 |
90 |
144 |
9×161+0×160 = 144 |
A0 |
160 |
10×161+0×160 = 160 |
B0 |
176 |
11×161+0×160 = 176 |
C0 |
192 |
12×161+0×160 = 192 |
D0 |
208 |
13×161+0×160 = 208 |
E0 |
224 |
14×161+0×160 = 224 |
F0 |
240 |
15×161+0×160 = 240 |
100 |
256 |
1×162+0×161+0×160 = 256 |
200 |
512 |
2×162+0×161+0×160
= 512 |
300 |
768 |
3×162+0×161+0×160
= 768 |
400 |
1024 |
4×162+0×161+0×160
= 1024 |
Uses and advantanges:
- Used by computer system designers and programmers.
- Each hexadecimal digit represents 4 binary digits.
- Hex numbers can be easily converted to binary.
- This format is quite compact and much easier to understand.
- Byte in binary can range from 00000000 to 11111111 which can be made more convinient represented as 00 to FF in hex.