Friday, February 19, 2016

Number Systems


Decimal Numbers

In practice we use a number system called decimal number system. In the decimal number system there are 10 numbers that we use 0,1,2,3,4,5,6,7,8,9. Using this ten numbers we can show any decimal value that we want to. Consider the number 251, we can describe it as
251= 2X(10^2)+5X(10^1)+1X(10^0) =(2X100)+(5X10)+10X1=200+50+1



So you can see that as we move from right to left in a number, for each position the power increases by one. Let us consider a few more examples
62= (6X10^2)+(2X10^0)=60+2
7821=7X(10^3)+8X(10^2)+2X(10^1)+(1X10^0)=7000+800=20+1.



Other number systems

In addition to the decimal number system there can be multiple different types of number system depending on number of literals that we want to use to describe a number.

In the hexadecimal number system in addition to the then literals 0...9 we also use the literals a,b,c,d,e,f. For the decimal number system this numbers correspond to a=10, b=11, c=12, d=13, e=14, f=15.

So (f)16=(15)10

If we want to convert a hexadecimal number to a decimal number, the method we need to follow is this:-

Consider and hexadecimal number (f2a)16 . Now let us convert this number into a decimal number

aX16^0+2X16^1+fX16^2

Now we know that a=10 and f=15. Hence the above equation becomes:

10X1+2X16+15X256=10+32+3840=3882.

Now to convert 3882 back to its hexadecimal form this what we will do.

16)3882(242
32
68
64
42
32
10

Reminder 10=f

16)242(15
240
2
Reminder 2

16)15(0
00
15
reminder 15=f

so the hexadecimal number become (f2a)16

In this way we can create any number system that we want to. We can even use an octadecimal number system by just increasing two more number, we can denote them as g and h, where g=16 and h=17.

Computers that we use today process the numbers as binary digits 0 or 1.

The decimal 5 is expressed as 101. Similarly (7)10=(111)2

Suppose there is a binary number 11001, this is how we find its decimal value.

We will move from right to left and keep increasing the power of 2 for each position. So
11001=1X2^0+0X2^1+0X2^2+1X2^3+1X2^4=1+0+0+8+16=25.

(11001)2=(25)10





No comments:

Post a Comment