Filed under: Uncategorized
Binary Tutorial Part 2
There are Binary number stuff and ya there are numbers and stuff involved so here. These are tables and words that describe this binary number stuff.
Now that the charts tell stuff it’s now time to look at more charts on how to convert Hexadecimal to base 10, here is the Hexadecimal system of system stuff.
Hexadecimal System uses 16 digits:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
And thus the base is 16.
Hexadecimal numbers are compact and easy to read.
It is very easy to convert numbers from binary system to hexadecimal system and vice-versa, every nibble (4 bits) can be converted to a hexadecimal digit using this table:
|
|
There is a convention to add “h” in the end of a hexadecimal number, this way we can determine that 5Fh is a hexadecimal number with decimal value of 95.
We also add “0″ (zero) in the beginning of hexadecimal numbers that begin with a letter (A..F), for example 0E120h.
The hexadecimal number 1234h is equal to decimal value of 4660:
If you want to learn how to convert decimals into hexadecimals all u do is divide, here are a lot of charts.
- Divide the decimal number by 16. Treat the division as an integer division.
- Write down the remainder (in hexadecimal).
- Divide the result again by 16. Treat the division as an integer division.
- Repeat step 2 and 3 until result is 0.
- The hex value is the digit sequence of the remainders from the last to first.
|
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 |
Example 1
Convert the number 1128 DECIMAL to HEXADECIMAL
|
NOTES |
DIVISION |
RESULT |
REMAINDER (in HEXADECIMAL) |
|
Start by dividing the number by 16. In this case, 1128 divided by 16 is 70.5. So the integer division result is 70 (throw out anything after the decimal point). The remainder is (70.5 – 70) multiplied with 16; or (0.5 times 16), which is 8. |
1128 / 16 |
70 |
8 |
|
Then, divide the result again by 16 (the number 70 on the DIVISION column comes from the previous RESULT). In this case, 70/16=4.375. So the integer division result is 4 (throw out anything after the decimal point) The remainder is (0.375 multiplied with 16, which is 6. |
70 / 16 |
4 |
6 |
|
Repeat. Note here that 4/16=0.25. So the integer division result is 0. The remainder is (0.25-0) multiplied with 16, which is 4. |
4 / 16 |
0 |
4 |
|
Stop because the result is already 0 (0 divided by 16 will always be 0) |
|
|
|
|
Well, here is the answer. These numbers come from the REMAINDER column values (read from bottom to top) |
|
|
468 |
Side note: You can get the remainder of a division using the Modulus or % operator. Ie: 1128%16=8.
Example 2
Convert the number 256 DECIMAL to HEXADECIMAL
|
DIVISION |
RESULT |
REMAINDER (in HEX) |
|
256 / 16 |
16 |
0 |
|
16 / 16 |
1 |
0 |
|
1 / 16 |
0 |
1 |
|
|
|
|
|
ANSWER |
|
100 |
Example 3
Convert the number 921 DECIMAL to HEXADECIMAL
|
DIVISION |
RESULT |
REMAINDER (in HEX) |
|
921 / 16 |
57 |
9 |
|
57 / 16 |
3 |
9 |
|
3 / 16 |
0 |
3 |
|
|
|
|
|
ANSWER |
|
399 |
Example 4
Convert the number 188 DECIMAL to HEXADECIMAL
|
DIVISION |
RESULT |
REMAINDER |
|
188 / 16 |
11 |
C (12 decimal) |
|
11 / 16 |
0 |
B (11 decimal) |
|
|
|
|
|
ANSWER |
|
BC |
Note that here, the answer would not be 1112, but BC. Remember to write down the remainder in hex, not decimal.
Example 5
Convert the number 590 DECIMAL to HEXADECIMAL
|
DIVISION |
RESULT |
REMAINDER |
|
590 / 16 |
36 |
E (14 decimal) |
|
36 / 16 |
2 |
4 (4 decimal) |
|
2 / 16 |
0 |
2 (2 decimal) |
|
|
|
|
|
ANSWER |
|
24E |
Leave a Comment so far
Leave a comment