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

HowTo: Convert Decimal numbers to other Number Systems


 

There are many number systems in the world. The number system that we use in our daily life is called the Decimal Number system. Whereas computers operate using a number system know as the Binary System.

One number system can be converted easily to another number system.

Conversion of Decimal To Binary

Decimal numbers can be converted to Binary format easily using continuous division of the decimal number by 2(because 2 is the base of binary system). Eg:-


In the above picture, we see how to convert decimal number 28 to the binary format using continuous division. 28 was continuously divided by 2 and the remainders were written next to it. Once we reach zero, we cannot divide it any more. Therefore the remainders that were written in the side, is read from bottom to top in order to find the decimal number 28's binary equivalent. Therefore we understand that 28(10) = 11100(2).

While converting decimal fractions to binary, we continuously multiply by two till we either get 1 or a repetitive pattern, and the whole number part of the decimal fraction is written beside it after every multiplication till we find the answer. Eg:-


In this image we see how the decimal number 0.125 can be converted to its binary equivalent. 0.125 is repetitively multiplied by 2 until we reach 1 and the whole number part of the fractional number is written besides the conversion after every multiplication. Once we reach either 1 or a repetitive pattern, we read the whole number part that is written besides the conversion from top to bottom to find the binary equivalent. Thus .125(10) = .001(2)

Conversion of Decimal To Octal/Hexadecimal 

Decimal numbers can be converted to octal/hexadecimal number systems in the same way how Decimal was converted to Binary using continuous division and multiplication, the only difference being while converting to Octal the decimal number should be divided and multiplied by 8 and in the case of Hexadecimal system, the decimal number should be multiplied and divided by 16.

Comments