Converting Binary to Hexadecimal ...
You need to become VERY familiar with the patterns below:
| Hex | F | E | D | C | B | A | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
| Binary | 1111 | 1110 | 1101 | 1100 | 1011 | 1010 | 1001 | 1000 | 0111 | 0110 | 0101 | 0100 | 0011 | 0010 | 0001 |
| Decimal | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
There is no easy way to remember the Hex to Binary conversions for A to F. You need to learn them so you can automatically write them down without thinking. Once you have learnt the A to F conversion the process of general conversion from Hex to Binary and back becomes very simple. (So learn them!!)
Binary to Hex
In the previous screens you converted a Hexadecimal number to Binary by expressing each Hex place as a Binary "quartet" (ie 4-bits). The process of converting from Binary to Hex uses the same 'quartet' approach, but in reverse.
| Example 1. Consider Binary: 1000100100110111 (a 16-bit Byte)STEP 1 Break the Byte into 'quartets' - 1000 1001 0011 0111 STEP 2 Use the table above to covert each quartet to its Hex equivalent - 8937 Therefore ... 1000100100110111 = 8937Hex |
| Example 2. Consider Binary 1111110001000001STEP 1 Break the Byte into 'quartets' - 1111 1100 0100 0001 STEP 2 Use the table above to covert each quartet to its Hex equivalent - FC41 Therefore ... 1111110001000001 = FC41Hex |
| Example 3. Consider Binary 11010101STEP 1 Break the Byte into 'quartets' - 1101 0101 STEP 2 Use the table above to covert each quartet to its Hex equivalent - D5 Therefore ... 11010101 = D5Hex Posted by: MUNEEB |
No comments:
Post a Comment