Included for your reference are the first few binary, octal and hexadecimal digit values.
This chart is meant to be a quick reference when determining powers of 2, 8 and 16. It will be useful when doing conversions between the various number systems.
Previously, we learned how to convert numbers from Decimal to Binary with 2 different methods: Repeated division by 2 and decomposing powers of 2.
Example: Convert 347 into binary:
347 / 2 = 173 R1
173 / 2 = 86 R1
86 / 2 = 43 R0
43 / 2 = 21 R1
21 / 2 = 10 R1
10 / 2 = 5 R0
5 / 2 = 2 R1
2 / 2 = 1 R0
1/2 = 0 R1
Reversed: 101011011 in Binary
Powers of 2 are: 512, 256, 128, 64, 32, 16, 8, 4, 2, 1
The largest that is less than 347 is 256 so we start there:
347 - 256 = 91
91 - 64 = 27
27 - 16 = 11
11 - 8 = 3
3 - 2 = 1
1 - 1 = 0
Which gives us 0101011011 in Binary
These procedures we learned for converting decimal to binary work for any base! We just need to change the base.
Binary is base 2, so we divide by 2 or subtract powers of 2. Octal is base 8, so we divide by 8 or subtract powers of 8.
When we divided by 2, we got remainders that were either 0 or 1. In the case of octal, you will be getting remainders of 0, 1, 2, 3, 4, 5, 6, 7 instead.
Start with 347 / 8 = 43 with a remainder of 3.
Use the previous result, 43, and start again:
43 / 8 = 5, R3
5 / 8 = 0, R5.
Now that we've reached our 0 quotient, we have our digits 3, 3, and 5 (remember! we only care about the remainders!), which we reverse to get 533 in Octal
So, 347 in base 10 is 533 in base 8.
1854 / 8 = 231 R6
231 / 8 = 28 R7
28 / 8 = 3 R4
3 / 8 = 0 R3
So 1854 base 10 = 3476 base 8
Again, this method, using decomposition of powers of 8 is the same as powers of 2, we just use different powers. We will use the chart at the top to do the conversion.
Starting with 347, we see that the largest power of 8 that is still smaller than 347 is 64. But wait...
347 - 64 = 283
Which is still bigger than 64. What do we do? Well, unlike binary, in octal we are going to have to subtract multiple times. We have to count the number of times we subtract 64 here before we get to a value less than 64:
347 - 64 = 283 -- 1
283 - 64 = 219 -- 2
218 - 64 = 155 -- 3
155 - 64 = 91 -- 4
91 - 64 = 27 -- 5
Now that we cannot subtract 64 anymore, we use the next power of 8, which in this case is 8:
27 - 8 = 19 -- 1
19 - 8 = 11 -- 2
11 - 8 = 3 -- 3
And finally, we can see that we would have to subtract one 3 times. Thus 347 base 10 is 533 base 8.
1854 - 512 = 1342, 1342 - 512 = 830, 830 - 512 = 318 -- 3 times
318 - 64 = 254, 254 - 64 = 190, 190 - 64 = 126 , 126 - 64 = 62 -- 4 times
62 - 8 = 54, 54 - 8 = 46, 46 - 8 = 38, 38 - 8 = 30, 30 - 8 = 22, 22 - 8 = 14, 14 - 8 = 6 -- 7 times with 6 ones left.
So 1854 base 10 is 3476 base 8
The procedure here is the same as for octal, with one exception. Since we are now going to divide by 16, our remainders will be between 0 and 15, so we have to convert those numbers from 10 to 15 into A to F.
347 / 16 = 21 with a remainder of 11, which we convert to B
21 / 16 = 1 with a remainder of 5. No conversion necessary.
1 / 16 = 0 with a 1 remainder.
So 347 base 10 = 15B base 16
1854 / 16 = 115 R14 or E
115 / 16 = 7 R3
7 / 16 = 0 R7
So, 1854 base 10 = 73E base 16
If we check the table at the top, the largest power of 16 that is less than 347 is 256, so:
347 - 256 = 91 -- 1 time
91 - 16 = 75, 75 - 16 = 59, 59 - 16 = 43, 43 - 16 = 27, 27 - 16 = 11 -- 5 times with 11 left over
11 as a hexadecimal digit is B, so 347 base 10 in hexadecimal is 15B
1854 - 256 = 1598, 1598 - 256 = 1342, 1342 - 256 = 1086, 1086 - 256 = 830, 830 - 256 = 574, 574 - 256 = 318, 318 - 256 = 62 -- 7 Times
62 - 16 = 46, 46 - 16 = 30, 30 - 16 = 14 -- 3 Times
14 in hexadecimal is E, so 1854 base 10 is 73E base 16
When can use the same procedure for converting octal and hexadecimal numbers into decimal numbers as we do with binary. Each digit represents a power of the base. Once we figure out what the decimal value of that power is, we multiply it by the digit and add the numbers together.
By referencing the chart at the top, we know that the first 3 digits in base 8 are worth 64, 8 and 1. So 672 in base 8 would then be broken down into:
6 x 64 + 7 x 8 + 2 x 1 = 384 + 56 + 2 = 442 base 10
Broken down: 3 x 512 + 1 x 64 + 4 x 8 + 8 x 1 = 1536 + 64 + 32 + 8 = 1640 base 10
By referencing the chart at the top, we know that the first 3 digits in base 16 are worth 256, 16 and 1. So DF3 in base 16 would then be broken down into:
D x 256 + F x 16 + 3 x 1
But we have to convert our hexadecimal digits back into decimal. In this example D = 13 and F = 15, thus:
13 x 256 + 15 x 16 + 3 x 1 = 3328 + 240 + 3 = 3571 base 10.
Using the chart above:
4 x 65536 + A x 4096 + F x 256 + 0 x 16 + 5 x 1
Convert the hexadecimal digits:
4 x 65536 + 10 x 4096 + 15 x 256 + 0 x 16 + 5 x 1
= 262,144 + 40,960 + 3,840 + 0 + 5 = 306,949 base 10
1. Using your method of choice, convert the following decimal numbers into Octal (base 8) and Hexadecimal (base 16)
a) 47
b) 526
c) 4096
d) 45012
2. Convert the following Octal numbers to Decimal
a) 55
b) 631
c) 7412
3. Convert the following Hexadecimal numbers to Decimal
a) F2
b) 301
c) CAB
d) 9ABC