Difference between revisions of "Conversions"

From TRCCompSci - AQA Computer Science
Jump to: navigation, search
(Hexadecimal to Denary)
(Denary to Hexadecimal)
Line 72: Line 72:
  
 
=Denary to Hexadecimal=
 
=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

Revision as of 16:55, 14 December 2016

Conversions

Conversions are the process in which one number system is converted to another, for example deanry 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

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. Binary system.jpg

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

We then read the binary number bottom to top including the last 1 (the one we got as a result of 3÷2) 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 Hexidecimal Powers.jpg

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.

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