Basics of Base Convertion

sid_19840

International Coach
Joined
Jun 28, 2005
Location
Kolkata,India
Online Cricket Games Owned
Although wrote this for the blog,thought that I should post it here.

Base Conversion

I decided to show you guys how to convert from one base number to another.


1.1)Basics:

Firstly,What are Bases?

They are basically a limit inside which a number can lie.Eg-For a decimal base the number limit is 0-9.So all numbers are either 0-9 or a combination of them.

Some other bases are Binary(0-1),Octal(0-7) and Hexadecimal(0-15 where number from 10 onwards are represented by character's A,B and so on untill F for 15).

1.2)The Convertion from Hexadecimal to Decimal:

Today I will show how to convert a Hexadecimal number to decimal number(as its most commonly used)

1)Reverse the digit.
2)Multiply each place(units,tenth's etc),by 16^I(where I is the place of the digit).

So for first digit I=0,then for the next I=1 and so on.
Convert the number 1128 HEXADECIMAL to DECIMAL
Reverse of the digit is= 8211

8*(16^0)+2*(16^1)+1*(16^2)+1*(16^3)

So on getting the results and adding them(using a calculator ofcourse).

(8+32+256+4096)=4392

Hence 8211 in hex = 4392 in decimal.

[Note:If you encounter a character such as A210,just replace A by its actual integer number as explained earlier,i.e A represents 10 so here it will be 10*(16^0) ]

1.3)Final Words:Just hoping that this would be useful.You can also make a small program for this convertion using any prog. language.Comments are most welcome.

Will try to post other convertion's later.
 
Thanks Sid for that. We did a bit of base conversion last year in my IT subject "Information Systems."
If you want, you could also teach us binary conversion (101010) as well. I certainly found it interesting. :)
 
Binary to Decimal Conversion

As I said in the earlier post,binary number's consist of only two digits 0 and 1.This must be kept in mind during conversions.

A)Binary to Decimal

Binary numbers are powers of two,just as in decimal the numbers are powers of 10.

In Decimal

H T U
1 2 4

Here 124 is a number with 4 in Units place,2 in tenths place and 1 in Hundreths place.Hence each place is 10 times more as decimal numbers are of base 10(0-9).Hence the value is (1*100)+(2*10)+4=124.

Similarly in binary the numbers are 2 times as bigger.Hence each place's value is twice more as shown below.

8 4 2 1
1 0 0 1

Hence to convert this to decimal we just add up the values for the numbers having 1.
Thus it is 8+1=9(Observe that 1 is only at 8th place and 1st place) for binary 1001.

Similarly try finding the decimal values of these numbers and post them.

a) 0100
b) 10001000
c) 11001101
d) 00010110

Decimal to Binary-Coming Soon
 

Users who are viewing this thread

Top