Representing Numbers Flashcards
What are the steps to convert binary to decimal?
Going from left to right assign 2^0 then 2^1,2^2 and so on
Then multiply the number (either 1 or 0) by the associated base two power
Add them up
What is 1010 in decimal?
(1 x 2^3) + (0 x 2^2) + (1 x 2^1) + (0 x 2^0)
= 8 + 0 + 2 + 0
=10
How does the subtraction method work for converting decimal to binary?
Find the highest base 2 number that is less than the number you are trying to convert and subtract it
Repeat the process
Use a 1 for the base 2 power than you subtracted and a 0 for the ones you didn’t use
Use the subtraction method to convert 75 to binary.
75-2^6 = 11
11-2^3 = 3
3-2^1 = 1
1-2^0 = 0
1001011
How does the division method work to convert decimal to binary?
Divide the number by two
If it ends with 0.5 the remainder is 1, if it’s a whole number the remainder is 0
Read the remainders from the most significant bit to the least significant bit (from last division to first division)
Use the division method to convert 75 to binary.
75/2= 37 R1
37/2= 18 R1
18/2= 9 R0
9/2= 4 R1
4/2= 2 R0
2/2=1 R0
1/2=0 R1
1001011
How can you tell which is the MSB and LSB when converting decimal to binary?
MSB is at the bottom, last division you do
LSB is at the top, first division you do
How can you convert decimal numbers to hexadecimal?
Divide the number you are trying to convert by 16
Use the integer as your next number and for the remainder multiply the decimal part by 16
Repeat until you hit 0
Take the remainders, convert them to hexadecimal, and read from MSB to LSB (bottom to top)
Convert 479 to hexadecimal.
479/16 =29.9875=29 R15
29/16= 1.8125 =1 R 13
1/16= 0.0625 =0 R 1
15–>F
13–>D
1–> 1
1DF
How can you convert hexadecimal to decimal?
Going from right to left label each number with 16^0, 16^1… and so on
Multiply that base 16 number by the number it’s assigned to
Add them up
What is 23E in decimal?
(2 x 16^2) + (3 x 16^1) + (14 x 16^0)
= 512 + 48 + 14
=574
If you are trying to convert a hexadecimal number that has decimals to decimal how would you do that?
Same thing but label the numbers to the right of decimal 16^-1, and so on
How can you convert hexadecimal to binary?
Assign each hexadecimal number a decimal number
Convert the decimal number to binary
Put them together in the order the original numbers are
Convert A9 to binary.
A=10
9=9
10-2^3=2-2^1
= 1010
9-2^3= 1-2^0
= 1001
10101001
How can you convert binary to hexadecimal?
Seperate into groups of 4
Convert to decimal
Assign the decimal numbers hexadecimal numbers
Put together in right order