Conversion Between Number Bases MATH 100 Survey of Mathematical Ideas J. Robert Buchanan Department of Mathematics Summer 2018
General Number Bases Bases other than 10 are sometimes used in numeration systems. Base 2, 8, and 16 (respectively binary, octal, and hexadecimal ) are used around computers. When we refer to a number expressed in a base other than 10, we will subscript the number with the base. 243 five = 243 5 In base-b we may only use the digits {0, 1, 2,..., b 1}.
Counting in Base-b In base-10 the digits are {0, 1, 2,..., 9} and we count 1 2 3 4 5 6 7 8 9
Counting in Base-b In base-10 the digits are {0, 1, 2,..., 9} and we count 1 2 3 4 5 6 7 8 9 10
Counting in Base-b In base-10 the digits are {0, 1, 2,..., 9} and we count 1 11 2 12 3 13 4 14 5 15 6 16 7 17 8 18 9 19 10
Counting in Base-b In base-10 the digits are {0, 1, 2,..., 9} and we count 1 11 2 12 3 13 4 14 5 15 6 16 7 17 8 18 9 19 10 20
Counting in Base-b In base-10 the digits are {0, 1, 2,..., 9} and we count 1 11 21... 2 12 22... 3 13 23... 4 14 24... 5 15 25... 6 16 26... 7 17 27... 8 18 28... 9 19 29... 10 20 30...
Counting in Base-b In base-10 the digits are {0, 1, 2,..., 9} and we count 1 11 21... 2 12 22... 3 13 23... 4 14 24... 5 15 25... 6 16 26... 7 17 27... 8 18 28... 9 19 29... 10 20 30... In base-6 the digits are {0, 1, 2,..., 5} and we count 1 11 21... 2 12 22... 3 13 23... 4 14 24... 5 15 25... 10 20 30...
Expanded Form Example 243 5 = (2 5 2 ) + (4 5 1 ) + (3 5 0 ) = 50 + 20 + 3 = 73
Expanded Form Example 243 5 = (2 5 2 ) + (4 5 1 ) + (3 5 0 ) = 50 + 20 + 3 = 73 Example 7654 8 = (7 8 3 ) + (6 8 2 ) + (5 8 1 ) + (4 8 0 ) = 3584 + 150 + 40 + 4 = 3778
Converting Between Bases To convert from base b to base 10: 1. Start with the first digit on the left and multiply by the base b. 2. Add the next digit and multiply again by the base b, and so on. 3. Add the last digit on the right (but do not multiply by the base).
Examples (1 of 2) Use the change of base algorithm to covert 345 to base-10 form (we know the answer will be 345).
Examples (1 of 2) Use the change of base algorithm to covert 345 to base-10 form (we know the answer will be 345). 3 10 = 30
Examples (1 of 2) Use the change of base algorithm to covert 345 to base-10 form (we know the answer will be 345). 3 10 = 30 30 + 4 = 34
Examples (1 of 2) Use the change of base algorithm to covert 345 to base-10 form (we know the answer will be 345). 3 10 = 30 30 + 4 = 34 34 10 = 340
Examples (1 of 2) Use the change of base algorithm to covert 345 to base-10 form (we know the answer will be 345). 3 10 = 30 30 + 4 = 34 34 10 = 340 340 + 5 = 345
Examples (2 of 2) Use the change of base algorithm to covert 345 8 to base-10 form.
Examples (2 of 2) Use the change of base algorithm to covert 345 8 to base-10 form. 3 8 = 24
Examples (2 of 2) Use the change of base algorithm to covert 345 8 to base-10 form. 3 8 = 24 24 + 4 = 28
Examples (2 of 2) Use the change of base algorithm to covert 345 8 to base-10 form. 3 8 = 24 24 + 4 = 28 28 8 = 224
Examples (2 of 2) Use the change of base algorithm to covert 345 8 to base-10 form. 3 8 = 24 24 + 4 = 28 28 8 = 224 224 + 5 = 229
Examples Convert each of the following numbers into decimal (base-10) form. Use your i>clicker to submit your responses. 1. 612 7
Examples Convert each of the following numbers into decimal (base-10) form. Use your i>clicker to submit your responses. 1. 612 7 2. 365 8
Examples Convert each of the following numbers into decimal (base-10) form. Use your i>clicker to submit your responses. 1. 612 7 2. 365 8 3. 6185 9
Examples Convert each of the following numbers into decimal (base-10) form. Use your i>clicker to submit your responses. 1. 612 7 2. 365 8 3. 6185 9 4. 101101110 2
Converting from Base-10 Converting from decimal (base-10) to another base can be done by repeated division.
Converting from Base-10 Converting from decimal (base-10) to another base can be done by repeated division. Example Convert 789 to base 6.
Converting from Base-10 Converting from decimal (base-10) to another base can be done by repeated division. Example Convert 789 to base 6. Base Dividend Remainder 6 789
Converting from Base-10 Converting from decimal (base-10) to another base can be done by repeated division. Example Convert 789 to base 6. Base Dividend Remainder 6 789 6 131 3
Converting from Base-10 Converting from decimal (base-10) to another base can be done by repeated division. Example Convert 789 to base 6. Base Dividend Remainder 6 789 6 131 3 6 21 5
Converting from Base-10 Converting from decimal (base-10) to another base can be done by repeated division. Example Convert 789 to base 6. Base Dividend Remainder 6 789 6 131 3 6 21 5 6 3 3
Converting from Base-10 Converting from decimal (base-10) to another base can be done by repeated division. Example Convert 789 to base 6. Base Dividend Remainder 6 789 6 131 3 6 21 5 6 3 3 6 0 3
Converting from Base-10 Converting from decimal (base-10) to another base can be done by repeated division. Example Convert 789 to base 6. Base Dividend Remainder 6 789 6 131 3 6 21 5 6 3 3 6 0 3 Thus 3353 6 = 789. Note that we read the remainders from bottom to top.
Another Conversion Convert 789 to base 4.
Another Conversion Convert 789 to base 4. Base Dividend Remainder 4 789
Another Conversion Convert 789 to base 4. Base Dividend Remainder 4 789 4 197 1
Another Conversion Convert 789 to base 4. Base Dividend Remainder 4 789 4 197 1 4 49 1
Another Conversion Convert 789 to base 4. Base Dividend Remainder 4 789 4 197 1 4 49 1 4 12 1
Another Conversion Convert 789 to base 4. Base Dividend Remainder 4 789 4 197 1 4 49 1 4 12 1 4 3 0
Another Conversion Convert 789 to base 4. Base Dividend Remainder 4 789 4 197 1 4 49 1 4 12 1 4 3 0 4 0 3
Another Conversion Convert 789 to base 4. Base Dividend Remainder 4 789 4 197 1 4 49 1 4 12 1 4 3 0 4 0 3 Thus 30111 4 = 789. Remember to read the remainders from bottom to top.
Examples Perform the following conversions. Use your i>clicker to submit your responses. 5. Convert 935 to base 8. Remember: numbers expressed in base b use only the digits {0, 1, 2,..., b 1}.
Examples Perform the following conversions. Use your i>clicker to submit your responses. 5. Convert 935 to base 8. 6. Convert 12888 to base 9. Remember: numbers expressed in base b use only the digits {0, 1, 2,..., b 1}.
Examples Perform the following conversions. Use your i>clicker to submit your responses. 5. Convert 935 to base 8. 6. Convert 12888 to base 9. 7. Convert 70893 to base 7. Remember: numbers expressed in base b use only the digits {0, 1, 2,..., b 1}.
Examples Perform the following conversions. Use your i>clicker to submit your responses. 5. Convert 935 to base 8. 6. Convert 12888 to base 9. 7. Convert 70893 to base 7. 8. Convert 11028 to base 4. Remember: numbers expressed in base b use only the digits {0, 1, 2,..., b 1}.
Hexadecimal (Base 16) Numbers The hexadecimal digits are {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F}.
Hexadecimal (Base 16) Numbers The hexadecimal digits are {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F}. Digit Name Base-10 Value Digit Name Base-10 Value 0 zero 0 8 eight 8 1 one 1 9 nine 9 2 two 2 A alpha 10 3 three 3 B bravo 11 4 four 4 C charlie 12 5 five 5 D dog 13 6 six 6 E echo 14 7 seven 7 F fox 15
Example The hexadecimal digits are {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F}.
Example The hexadecimal digits are {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F}. Convert 16355 to hexadecimal.
Example The hexadecimal digits are {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F}. Convert 16355 to hexadecimal. Base Dividend Remainder 16 16355
Example The hexadecimal digits are {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F}. Convert 16355 to hexadecimal. Base Dividend Remainder 16 16355 16 1022 3
Example The hexadecimal digits are {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F}. Convert 16355 to hexadecimal. Base Dividend Remainder 16 16355 16 1022 3 16 63 14=E
Example The hexadecimal digits are {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F}. Convert 16355 to hexadecimal. Base Dividend Remainder 16 16355 16 1022 3 16 63 14=E 16 3 15=F
Example The hexadecimal digits are {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F}. Convert 16355 to hexadecimal. Base Dividend Remainder 16 16355 16 1022 3 16 63 14=E 16 3 15=F 16 0 3
Example The hexadecimal digits are {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F}. Convert 16355 to hexadecimal. Thus 3FE3 16 = 16355. Base Dividend Remainder 16 16355 16 1022 3 16 63 14=E 16 3 15=F 16 0 3
Conversion Between Base 2 and Base 8 Base-10 Base-8 Base-2 0 0 8 000 2 1 1 8 001 2 2 2 8 010 2 3 3 8 011 2 4 4 8 100 2 5 5 8 101 2 6 6 8 110 2 7 7 8 111 2
Conversion Between Base 2 and Base 16 Base-10 Base-16 Base-2 0 0 16 0000 2 1 1 16 0001 2 2 2 16 0010 2 3 3 16 0011 2 4 4 16 0100 2 5 5 16 0101 2 6 6 16 0110 2 7 7 16 0111 2 8 8 16 1000 2 9 9 16 1001 2 10 A 16 1010 2 11 B 16 1011 2 12 C 16 1100 2 13 D 16 1101 2 14 E 16 1110 2 15 F 16 1111 2
Example (1 of 4) Convert 216 8 to binary (base-2).
Example (1 of 4) Convert 216 8 to binary (base-2). 1. Write each octal (base-8) digit as a three-digit binary (base-2) number. 216 8 = 010001110 2
Example (1 of 4) Convert 216 8 to binary (base-2). 1. Write each octal (base-8) digit as a three-digit binary (base-2) number. 2. Group all the binary digits. 216 8 = 010001110 2 216 8 = 010001110 2 = 10001110 2
Example (2 of 4) Convert 11010111101 2 to octal (base-8).
Example (2 of 4) Convert 11010111101 2 to octal (base-8). 1. Starting on the right, make groups of three binary digits. 11010111101 2 = 11010111101 2 = 011010111101 2
Example (2 of 4) Convert 11010111101 2 to octal (base-8). 1. Starting on the right, make groups of three binary digits. 11010111101 2 = 11010111101 2 = 011010111101 2 2. Convert each group of three binary digits into a single octal digit. 011010111101 2 = 3275 8 = 3275 8
Example (3 of 4) Convert F4 16 to binary (base-2).
Example (3 of 4) Convert F4 16 to binary (base-2). 1. Write each hexadecimal (base-16) digit as a four-digit binary (base-2) number. F4 16 = 11110100 2
Example (3 of 4) Convert F4 16 to binary (base-2). 1. Write each hexadecimal (base-16) digit as a four-digit binary (base-2) number. 2. Group all the binary digits. F4 16 = 11110100 2 F4 16 = 11110100 2
Example (4 of 4) Convert 37 8 to hexadecimal (base-16).
Example (4 of 4) Convert 37 8 to hexadecimal (base-16). 1. Write each octal (base-8) digit as a three-digit binary (base-2) number. 37 8 = 011111 2
Example (4 of 4) Convert 37 8 to hexadecimal (base-16). 1. Write each octal (base-8) digit as a three-digit binary (base-2) number. 37 8 = 011111 2 2. Group all the binary digits into groups of four digits. 011111 2 = 011111 2 = 00011111 2
Example (4 of 4) Convert 37 8 to hexadecimal (base-16). 1. Write each octal (base-8) digit as a three-digit binary (base-2) number. 37 8 = 011111 2 2. Group all the binary digits into groups of four digits. 011111 2 = 011111 2 = 00011111 2 3. Convert each group of four binary digits to a hexadecimal digit. 00011111 2 = 1F 16