Welcome to College Techies, the place for nerds to find the best Tech and IT related news, reviews, tutorials and more!!

HowTo: Convert Binary numbers to other number systems

The Binary Number system is a system which has a base 2, meaning that there are only two digits in this system.

In this post, we will see how to convert Binary numbers to decimal, octal and hexadecimal numbers.

Binary To Decimal

Binary numbers can be converted into decimal numbers by simply multiplying each bit with its place value. That is by multiplying each bit with 2n before the decimal point and with 2-n after the decimal point. Eg:-

To convert 1011(2) to a decimal, we do : 20 * 1 + 21 * 1 + 22 * 0 + 23 * 1, which is equal to 11. That is 1011(2) = 11(10).

Binary To Octal

Binary numbers can be converted into Octal number system by grouping the binary number into 3 bits each starting from the right most bit before the decimal point and then starting from leftmost bit after the decimal point, and then individually converting each group into octal number system by multiplying each bit of the group with its place value. Eg:-

To convert 1011(2) into the Octal number system, we group them into three bits starting from the rightmost bit before the decimal point, such as 1 011, and then multiplying it with its place value like 1 * 20  0 * 22 + 1 * 21 + 1 * 20 which gives us 1 2+1, which when regrouped is 13. Thus 1011(2) = 13(8).

Binary To Hexadecimal

Converting Binary numbers to the Hexadecimal system is completely same as how we convert Binary numbers to the Octal system, where the only difference being, 4 bits are grouped together instead of three, starting from the rightmost bit before the decimal point, and then from left to right after the decimal point.

 

Comments