Last time we have seen the methods and way to convert the Decimal numbers to Binary, Octal and Hexadecimal. Today I will tell you how you can convert the Binary, Octal and Hexadecimal numbers to Decimal
Binary to Decimal
(101)2=(?)10 (Convert binary 101 to decimal). Now we have 101 means three digit, so let us consider n=3.
101 = 1 x 2n-1+ 0 x 2n-2 + 1 x 2n-3
= 1 x 23-1 + 0 x 23-2 + 1 x 2n-3
= 1 x 22 + 0 x 21 + 1 x 20
= 1 x 4 + 0 x 2 + 1 x 1
= 4 + 0 + 1 = 5
= (101)2 = (5)10
For fractional Numbers :
(.11)2=(?)10
Here 'n' is 2,
.11 = 1 x 2n-(n+1) + 1 x 2n-(n+2)
= 1 x 2-1 + 1 x 2n-2
= 1/21 + 1/22
= 1/2 +1/4
= 3/4 = .75
= (.11)2 - (.75)10
Another example : (11.011)2 - (?)10
= 1 x 21+ 1 x 20 + 0 x 2-1 + 1 x 2-2 + 1 x 2-3
= 1 x 21 + 1 x 20 + 0 x 2-1 + 1 x 2-2 + 1 x 2-3
= 2 + 1 + 1/4 + 1/8
= 3.3/8 = 3.375
= (11.011)2 - (3.375)10
Easy way out:
8 4 2 1 2 4
1 0 0 1 . 1 1
Check the numbers on the top, its 20 onwards 2n-1, values written on the top for whole number right most digit to start with and for fractional numbers left most digit. For whole numbers add the values for non zero elements like 1 and 8 because 4 and 2 having a '0' below it. So by adding 8 + 1 =9 and divide the values for fractional numbers: 1/2 + 1/4 = 3/4 = .75.
(1001.11)2=(9.75)10
Octal to Decimal
if you understand the conversion of Binary to decimal then other number system will be same process with different power.
Octal to Decimal
(56.34)8=(?)10
Two digit means n=2,
= 5 x 8n-1+ 6 x 8n-2 + 3 x 8n-(n+1)+ 4 x 8n-(n+2)
= 5 x 81+ 6 x 80 + 3/81+ 4 x 82
= 5 x 8 + 6 X 1 + 3/8 + 4/ 64
= 40 + 6 + 3/8 + 4/ 64
= 46.4375
= (56.34)8 = (46.4375)10
Hexadecimal to Decimal
(75.55)16=(?)10
Two digit means n=2, so
= 7 x 16n-1+ 5 x 16n-2 + 5 x 16n-(n+1)+ 5 x 16n-(n+2)
= 7 x 161+ 5 x 160 + 5/161+ 5 x 162
= 7 x 16 + 5 x 1 + 5/16 + 5/256
= 112 + 5 + 5/16 + 5/256
= 117.332031
(75.55)16 = (117.332031)10
Another Example :
(3A.B)16=(?)10
Here 'A to F' to be considered as 10 to 15 and as a single unit
3 x 16n-1+ 10 x 16n-2 +11 x 16n-(n+1)
= 3 x 16 + 10 x 1 + 11/16
= 48 + 10 + 11/16
= 58.6875
= (3A.B)16 = (58.6875)10
Octal to Binary and Binary to Octal
Last number of Octal number system is 7. 7 equivalent to binary is 111, that means three digit. so while converting Octal to binary just write down the binary value of the octal number.
(56.34)8=(?)2
5 6 . 3 4
101 110 011 100(56.34)8=(101110.011100)2
Same for Binary to Octal, only first you have to three digits of binary nose, where for whole number start from last digit and fractional numbers start from first digit. At the end if numbers of digits less than three than put a leading zero for whole number and a trailing zero for fractional part.
(1011011101.1101101)2=(?)8
001 011 011 101 . 110 110 100
1 3 3 5 . 6 6 4
(1011011101.1101101)1=(13335.664)8
Hexadecimal to Binary and Binary to Hexadecimal
Last number of Octal number system is F means 15. 15 equivalent to binary is 1111, that means four digit. so while converting Hexadecimal to binary just write down the binary value of the Hexadecimal number.
(7A.3B)16=(?)20111 1010 . 0011 1011
7 A . 3 B
(7A.3B)16=(01111010.00111011)2
Same for Binary to Hexadecimal, only first you have to group four bits for whole numbers right to left and for fractions left to right At the end if numbers of digits less than three than put a zero at leading position for whole numbers and a trailing zero for fractional part.
(1010011100.1101101)2=(?)8
0010 1001 1100 . 1101 1010
2 9 12 . 13 10
(1011011101.1101101)2=(29C.DA)16
No comments:
Post a Comment