Converting a base 10 to a base 2 or base 16 number
Using division, you can convert a base 10 (decimal) to both base 2 (binary) and base 16 (hexadecimal).
Convert 2910 to base 2 (binary).
■ Divide the number by the base you want it in until you get 0. ■ You want base 2 so you divide by 2. Step 1: divide the number by 2. 29 ÷ 2 = 14 r 1 Step 2: take the quotient (the result) and divide it by 2. 14 ÷ 2 = 7 r 0 Step 3: repeat this process until you have 0 — quotient divided by 2. 7 ÷ 2 = 3 r 1 Still not 0? Repeat — quotient divided by 2. 3 ÷ 2 = 1 r 1 Still not 0? Repeat — quotient divided by 2. 1 ÷ 2 = 0 r 1 Make sure you write your remainder, as this will be used to make the answer. Step 4: now you have 0, write all the remainders from the last to the first; 11101.
convert 10010 to binary (base 2)
Step 1: divide 100 by 2. 100 ÷ 2 = 50 r 0 Step 2: divide the quotient by 2. 50 ÷ 2 = 25 r 0 Step 3: repeat until you have 0. 25 ÷ 2 = 12 r 1 12 ÷ 2 = 6 r 0 6 ÷ 2 = 3 r 0 3 ÷ 2 = 1 r 1 1 ÷ 2 = 0 r 1 Continue dividing by 2 until you have 0. Step 4: write all the remainders, from the last to the first, 1100100.
Convert 2910 to base 16 ( hexadecimal)
Step 1: divide the number by 16.
29 ÷ 16 = 1 r 13 Step 2: divide the quotient by 16. 1 ÷ 16 = 0 r 1 Step 3: repeat until you have 0. Step 4: write the remainders, from the last to first; 1 13. Step 5: check for numbers over 9. You can’t use the number 13 in hexadecimal. You need to replace it with the appropriate letter, D 1 13 becomes 1D
0 Comments
Leave a Reply. |
AuthorLearn the facts about Computer Science. Archives
September 2020
Categories |