Example: Convert 17710 to octal and binary
Division | Result | Binary |
177/8 | = 22+ remainder of 1 | 1 (Least Significant Bit) |
22/ 8 | = 2 + remainder of 6 | 6 |
2 / 8 | = 0 + remainder of 2 | 2 (Most Significant Bit) |
Result | 17710 | = 2618 |
Binary | | = 0101100012 |
Hexadecimal to Decimal/Decimal to Hexadecimal Conversion
Example:
2AF16 = 2 x (162) + 10 x (161) + 15 x (160) = 68710
Repeat Division- Convert decimal to hexadecimal
This method uses repeated division by 16.
Example: convert 37810 to hexadecimal and binary:
Division | Result | Hexadecimal |
378/16 | = 23+ remainder of 10 | A (Least Significant Bit)23 |
23/16 | = 1 + remainder of 7 | 7 |
1/16 | = 0 + remainder of 1 | 1 (Most Significant Bit) |
Result | 37810 | = 17A16 |
Binary |
| = 0001 0111 10102 |
Binary-To-Hexadecimal /Hexadecimal-To-Binary Conversion
Hexadecimal Digit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
Binary Equivalent | 0000 | 0001 | 0010 | 0011 | 0100 | 0101 | 0110 | 0111 |
Hexadecimal Digit | 8 | 9 | A | B | C | D | E | F |
Binary Equivalent | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 |
Each Hexadecimal digit is represented by four bits of binary digit.
Example:
1011 0010 11112 = (1011) (0010) (1111)2 = B 2 F16
Octal-To-Hexadecimal Hexadecimal-To-Octal Conversion
- Convert Octal (Hexadecimal) to Binary first.
- Regroup the binary number by three bits per group starting from LSB if Octal is required.
- Regroup the binary number by four bits per group starting from LSB if Hexadecimal is required.
Convert 5A816 to Octal.
Hexadecimal | Binary/Octal |
5A816 | = 0101 1010 1000 (Binary) |
| = 010 110 101 000 (Binary) |
Result | = 2 6 5 0 (Octal) |
Binary Codes
Binary codes are codes which are represented in binary system with modification from the original ones. Below we will be seeing the following:
- Weighted Binary Systems
- Non Weighted Codes
Weighted binary codes are those which obey the positional weighting principles, each position of the number represents a specific weight. The binary counting sequence is an example.
Decimal | 8421 | 2421 | 5211 | Excess-3 |
0 | 0000 | 0000 | 0000 | 0011 |
1 | 0001 | 0001 | 0001 | 0100 |
2 | 0010 | 0010 | 0011 | 0101 |
3 | 0011 | 0011 | 0101 | 0110 |
4 | 0100 | 0100 | 0111 | 0111 |
5 | 0101 | 1011 | 1000 | 1000 |
6 | 0110 | 1100 | 1010 | 1001 |
7 | 0111 | 1101 | 1100 | 1010 |
8 | 1000 | 1110 | 1110 | 1011 |
9 | 1001 | 1111 | 1111 | 1100 |
8421 Code/BCD Code
The BCD (Binary Coded Decimal) is a straight assignment of the binary equivalent. It is possible to assign weights to the binary bits according to their positions. The weights in the BCD code are 8,4,2,1.
Example: The bit assignment 1001, can be seen by its weights to represent the decimal 9 because:
1x8+0x4+0x2+1x1 = 9
No comments:
Post a Comment