Converting from Binary to
hexadecimal and from
hexadecimal to into binary
16^3+16^2+16^1+16^0
4096 + 256 + 16 + 1
Converting from binary to
hexadecimal
• 10101000110110
• First split into groups of 4-digits starting from the right to the left
hand side
• 10 1010 0011 0110
• Add two zeros “00” to the last digits since its not up to 4-digits
• 0010 1010 0011 0110
• Use the table to find the equivalent hexadecimal digits
• 2 A 3 6
EXERCISE
TOPIC: HEXADECIMAL
INSTRUCTION: Convert the following from binary to hexadecimal
• 1) 101110010101
• 1011 1001 0101
• B 9 5
• 2) 001101001010101
• 0001 1010 0101 0101
• 1 A 5 5
• 3) 1110011010101
• 0001 1100 1101 0101
• 1 C D 5
• 4) 1000111001
• 0010 0011 1001
• 2 3 9
• 5) 1100011011001011
• 1100 0110 1100 1011
• C 6 C B
• Converting from hexadecimal to binary is also very straight forward.
Using the data in the table provided earlier. Simply take each
hexadecimal digit and write down the 4-bit code which correspond to
the digit
• Example:
• 1) 4 5 A
• Using the table, find the 4-digit code for each digit:
• 2) 0100 0101 1010
• Put the groups together to form the binary number
• 3) 010001011010
example
•BF08
• Again use the table to find the 4-bit code for each digit
• 1011 1111 0000 1000
• Put all the digits together
• 1011111100001000
Try this
• D27E
• 1101 0010 0111 1110
• 1101001001111110
• 4F2B
• 0100 1111 0010 1011
• 0100111100101011
• 9D4
• 1001 1101 0100
• 100111010100
• B47D
• 1011 0100 0111 1101
• 1011010001111101
Exercise
Topic: Hexadecimal
Instruction: Convert the following hexadecimal
numbers into binary
• 1. 6 C
• 0110 1100
• 0110110
• 2. 5 9
• 0101 1001
• 01011001
• 3. A A
• 1010 1010
• 10101010
• 4. A 0 0
• 1010 0000 0000
• 101000000000
• 5. 4 0 E
• 0100 0000 1110
• 010000001110
• 6. B A 6
• 1011 1010 0110
• 101110100110
• 7. 9 C C
• 1001 1100 1100
• 100111001100
• 8. 4 0 A A
• 0100 0000 1010 1010
• 0100000010101010
• 9. D A 4 7
• 1101 1010 0100 0111
• 1101101001000111
• 10. 1 A B 0
• 0001 1010 1011 0000
• 0001101010110000
CONVERTING FROM HEXADECIMAL
TO DENARY & FROM DENARY TO
HEXADECIMAL
• (16^3) + (16^2) + (16^1) + (16^0)
• 256 16 1
•45A
• (4 * 16^2) + (5 * 16^1) + (10 * 16^0)
• 1024 + 80 + 10
• 1114
• C8F
• (12*16^2) + (8*16^1) + ( 15 * 16^0)
• 3072 + 128 + 15
• 3215
ASSIGNMENT
TOPIC: HEXADECIMAL
INSTRUCTION: Convert the following hexadecimal numbers to
denary
A. 6 B = (6*16^1) + (11*16^0) = 96 + 11 = 107
B. 9 C = (9*16^1) + (12*16^0) = 144 + 12 = 156
C. 4 A = (4*16^1) + ( 10*16^0) = 64 + 160 = 224
D. F F = ( 15*16^1) + (15*16^0) = 240 + 15 = 255
E. 1 F F = ( 1*16^2) + (15*16^1) + (15*16^0) = 256 + 240 + 15 = 511
Converting from
denary to hexadecimal
Method 1
• Consider the conversion of the denary number, 2004, into
hexadecimal. This method involves placing hexadecimal
digits in the appropriate position so that the total equates to
2004:
• 256=16^2 16=16^1 1=16^0
•7 D 4 (Note that D = 13)
• A quick check shows that: (7 * 256) + (13 * 16) + (4 * 1) gives
2004
Method 2
• This method involves successive division by 16. The remainders are
then read from BOTTOM to TOP to give the hexadecimal value.
Again using 2004, we get:
16 2004 remainder
16 125 4
16 7 13
0 7
• Read the remainder from bottom to the top to get the hexadecimal
number: 7 D 4
Convert the following denary
numbers into hexadecimal using
both methods
• Method 1: Convert the denary number 98 into hexadecimal number
• 16 1
•6 2
• Let’s check and see
• (6 * 16) + (2 * 1)
Method 2: converting denary
number 98 into hexadecimal
16 98 Remainder
16 6 2
0 6
62
Checking (6*16) + (2*1)
Example 3: converting denary
number 227 into hexadecimal
16 227 Remainder
16 14 3
16 0 14
143
Checking (14 * 16) + (3 * 1)
= 98
Example 4: converting denary
number 490 into hexadecimal
16 490 Remainder
Example : converting denary
number 511 into hexadecimal
16 511 Remainder