Difference between revisions of "Conversions"
(→Conversions) |
(→Conversions) |
||
Line 6: | Line 6: | ||
<youtube>https://www.youtube.com/watch?v=DoQV6wp35Gw&list=PLCiOXwirraUDGCeSoEPSN-e2o9exXdOka&index=5</youtube> | <youtube>https://www.youtube.com/watch?v=DoQV6wp35Gw&list=PLCiOXwirraUDGCeSoEPSN-e2o9exXdOka&index=5</youtube> | ||
− | + | https://www.youtube.com/watch?v=DoQV6wp35Gw&list=PLCiOXwirraUDGCeSoEPSN-e2o9exXdOka&index=5 | |
=Binary to Denary= | =Binary to Denary= |
Revision as of 11:51, 10 June 2018
Contents
Conversions
Conversions are the process in which one number system is converted to another, for example denary to binary.
The two conversion methods mainly used are the Place value method and the Repeated division method, however the repeated divsion method only works when converting denary to any other number base
https://www.youtube.com/watch?v=DoQV6wp35Gw&list=PLCiOXwirraUDGCeSoEPSN-e2o9exXdOka&index=5
Binary to Denary
Converting binary to denary is done using the place value method, to do this you need to know the binary number system.
To convert using the place value method you write out your binary number and starting from the far right digit, substitute its corresponding denary value in if the binary number is a 1 and don't substitute it in if it's a 0.
Then add up all of the denary values and you will have the converted denary value.
For example:
Column Value 16 8 4 2 1 Binary Number 1 0 1 0 1
You would then add up the denary numbers that were substituted.
So 10101 represents 16+4+1=21 so your denary value would be 21.
Denary to Binary
Place Value Method
In order to convert denary to binary with the place value method you need to split your denary number up into the binary system values that add up to total it, starting with the largest value that wouldn't cause the total to exceed the denary number
For example 50 would be broken down into 32,16 and 2, 64 isn't used even though its a larger value as it would cause the total to exceed 50.
You would then starting from the left place 1's and 0's in the appropriate columns for the used and unused numbers.
Column Value 32 16 8 4 2 1 Binary Number 1 1 0 0 1 0
Therefore the denary number 50 when converted to binary would read 110010.
Repeated Division Method
The repeated division method for denary to binary is done by taking the denary number you wish to convert and repeatedly dividing it by 2 as binary is base 2.
When you divide the denary number by 2 you write down the result and the remainder until the result is 0. The final 1 and the remainders are read starting from the bottom and going up.
Using 50 as an example again
50÷2 = 25 remainder 0 25÷2 = 12 remainder 1 12÷2 = 6 remainder 0 6÷2 = 3 remainder 0 3÷2 = 1 remainder 1 1÷2 = 0 remainder 1
We then read the binary number bottom to top which gives us a final answer of 110010.
Hexadecimal to Denary
Converting hexadecimal to denary is done using the place value method, to do this you need to know the hexadecimal number system
The conversion method is the same as when converting denary to binary but you need to know the hexadecimal values.
To convert a hexidecimal number to denary, starting from the right you would multiply the hexadecimal number by its denary value from the hexadecimal number system.
The other method is to convert from hex to binary. Then from binary to denary. This will yield the same results but is more prone to mistakes and takes longer.
For example:
Converting for 2A9 to denary you would multiply, starting from the right, the 9 in the hexadecimal number by its corresponding denary value on the far right of the table 1, you would then multiply A by 16, substituting in A's value in hexadecimal which is 10 and then multiply 2 by 256.
So to convert 2A9 to denary you would do 2x256 + 10x16 + 9x1 = 681. Meaning 2A9 in denary would be 681
Denary to Hexadecimal
Place value method:
In order to convert denary to hexadecimal with the place value method, just like denary to binary you split up the denary number into the hexadecimal systen denary values that add up to it starting with the largest. However unlike denary to binary where you fit the largest value into the number once, when converting denary to hexadecimal you fit each value into the denary number as many times as possible.
For example: Converting 1000 from denary to hexadecimal.
You take the largest hexadecimal denary value that goes into it without exceeding it, 256, which can go into 100 3 times before exceeding it which gives us 3x256. We then take the next hexadecimal denary value 16 which can fit into the remaining 232 14 times giving us 14x16. The remaining final hexadecimal denary value 1, fits into the remaining 8, 8 times giving us 8x1
We then turn these values into their hexadecimal values and add them together, 3 and 8 remain as they are and 14 becomes its hexadecimal value E
so to convert 1000 from denary to hexadecimal we get 1000 = 3x256 + 14x16 + 8 = 3E8
Repeated Division Method:
This method is the same as it is for Denary to Binary except you divide by 16 each time instead of 2
You take your hexadecimal number and divide it by 16, writing down the result and the remainder. You keep diving the result and writing down the remainder until you reach 0. When this happens you read you remainders from bottom to top which gives you the numbers Hexadecimal value.
For example convert 12345 to hexadecimal:
12345÷16 = 771 remainder 9 771÷16 = 48 remainder 3 48÷16 = 3 remainder 0 3÷16 = 0 remainder 3
Reading the remainders from bottom to top gives us the hexadecimal number 3039.
Binary to Hexadecimal
The conversions between binary and hexadecimal are very similar, both conversions have you splitting up the number in order to convert it, as 4 binary digits can be represented by 1 hexadecimal digit.
To convert a Binary Number to a Hexadecimal number you need to split the binary number up into groups of 4 bits, starting from the right.
Example:
01011111
Split the number into 2 groups of 4. 0101 and 1111. Then use the place value method to get the hexadecimal equivalent of each group.
8 4 2 1
0 1 0 1 = 5
1 1 1 1 = 15 which in hexadecimal is F
so 01011111 in hexadecimal is 5F
Hexadecimal to Binary
This conversion is the exact same as Binary to Hexadecimal but reversed, each hexadecimal digit is written as a string of 4 binary numbers
Example:
A7
A = 10 = 8+0+2+0 = 1010
7 = 0+4+2+1 = 0111
so A7 as in binary is 10100111