Hexadecimal
Overview Hexadecimal (hex) ~ base 16 number system Use 0 through 9 and... A = 10 B = 11 C = 12 D = 13 E = 14 F = 15
Decimal Example 2657= = 2* * *10 + 7*1 = 2* * * *10 0
Binary Example = 1* * * *2 0 = 1*8 + 0*4 + 1*2 + 1*1 = = 11 10
Hexadecimal Example A4F 16 = 10* * *16 0 = 10* * *1 = =
Hexadecimal Decimal = ? F23 16 = ? Now convert the above to binary...
Decimal Hexadecimal 1. Given the powers of 16: 1, 16, 256, 4096, etc. 2. Find the power that is just bigger than your number 3. Go down to the next smallest power of Divide your number by that power 5. Round the result down 6. Make note of the result for that power of Multiply the rounded down result by its corresponding power of 16…and then subtract that from your original number 8. Using the result from Step 7, repeat Steps 1-7 until you reach 0
So why do we use hex? Binary is annoying to read Hexadecimal is slightly easier Binary Hexadecimal is painless Example: = ?
Binary Hexadecimal 1. Split the binary number up into 4-bit sections 2. Determine the hexadecimal value of each section 3. Bam…you’re done Example:
Hexadecimal Binary 1. Determine the 4-bit binary value for each hexadecimal digit 2. Bam…you’re done