Computer Number System
Introduction
A Number system
is used for counting objects. We will see how different the world of computers
is from the world of humans. Native mode for humans is a base 10 positional
numbering system. For computers, the native mode is binary.
Types
of Number System
1. Binary
2. Octal
3. Decimal
4. Hexadecimal
1.
Binary Numbers
The binary number system is the most
important number system used in digital systems. Binary means Two. Binary
number systems use only two numbers (0, 1) to represent all possible numbers.
2.
Octal Numbers
The octal number system is called as Base8
numbering system, means eight digits represent all the possible numbers. The
digits are 0, 1, 2, 3, 4, 5, 6 and 7.
3.
Decimal Numbers
Decimal number system is the most commonly
used number system. It is used by humans for a variety of calculations, since
this is the easiest of all number system. This system uses digits from 0-9. It
is also known as Base-10 numbering system.
4.
Hexadecimal Numbers
Hexadecimal number system is another number system which is widely used in digital systems. Hexadecimal means 16. It has a base of 16 and uses 16 digits to represent all numbers. The hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. This last six digits are substitutes for 10, 11, 12, 13, 14, and 16 respectively.
All
Number System at a glance
Binary (Base 2) |
Octal (Base 8) |
Decimal (Base 10) |
Hexadecimal (Base 16) |
0000 |
000 |
0 |
0 |
0001 |
001 |
1 |
1 |
0010 |
010 |
2 |
2 |
0011 |
011 |
3 |
3 |
0100 |
100 |
4 |
4 |
0101 |
101 |
5 |
5 |
0110 |
110 |
6 |
6 |
0111 |
111 |
7 |
7 |
1000 |
|
8 |
8 |
1001 |
|
9 |
9 |
1010 |
|
10 |
A |
1011 |
|
11 |
B |
1100 |
|
12 |
C |
1101 |
|
13 |
D |
1110 |
|
14 |
E |
1111 |
|
15 |
F |
Number
Conversion
We have seen the
different kinds of number systems. When these number systems are used for a
computing purpose, there might be a need to convert them from one number system
to another. Let us look at some of the number conversions.
1.
Binary to Decimal Conversion
Method:
Step
1:- Find the weight of every binary digit
1 1 0 0 1
24 23 22 21 20
Step
2:- The Decimal equivalent of a binary number equals the sum of all binary
digits multiplied by their weights.
= (1* 24 + 1* 23 + 0* 22 + 0* 21 +1* 20)
16+8+0+0+1 =25
Therefore, the decimal equivalent of binary
11001 is 25.
An efficient way to convert a binary number
to its decimal equivalent is
1. Write the binary number
2. Write the weights 1, 2, 4, 8, 16…..
under the binary digits from right to left (These are the powers of 2)
3. Cross out any weight under a 0 (Do not
consider this weight )
4. Add the remaining weights
Decimal to Binary Conversion
2|123
1--------------------------2 divides 123, 61 times with a remainder of 1
2|61
1--------------------------2 divides 61, 30 times with a remainder of 1
2|30
0--------------------------2 divides 30, 15 times with a remainder of 0
2|15
1--------------------------2 divides 15, 7 times with a remainder of 1
2|7
1--------------------------2 divides 7, 3 times with a remainder of 1
2|3
1--------------------------2 divides 3, 1 times with a remainder of 1
Reading the remainders from bottom to top,
we have: (123)10 = (1111011)2
2.
Hexadecimal of Binary Conversion
In order to convert a hexadecimal number to
a binary number, each hexadecimal digit has to be converted to its 4 bit
equivalent.
To convert 9AF to binary, the following has
to be done
9 A F
1001 1010 1111
To convert C5E2 to binary, this is how it
has to be done.
C 5 E 2
1100 0101 1110 0010
3.
Binary to Hexadecimal conversion
In order to convert a binary number to its
hexadecimal equivalent, each nibble is weighed up. Inn digital systems an 8-bit
number is called as a byte and a 4-bit number is called as a nibble. The
individual bits are then summed up to get hexadecimal equivalent.
A binary number such as 1000 1100 has a
hexadecimal equivalent of 8C.
1000 1100
8 C
Note that 8 is 23. C gets its value from
the total sum of 23 and 22.
8= 23 + 02 + 01 + 00
C=23 + 22 + 01 + 00
4.
Hexadecimal to Decimal Conversion
A method to convert from hexadecimal to
decimal is to convert from hexadecimal to binary and from binary to decimal.
To convert 3C to its binary equivalent
Step
1:
3 C
0011 1100
Step
2:
Now convert 0011 1100 to its decimal
equivalent:
0 0 1 1 1 1 0 0
27 + 26 + 25 + 24 + 23 + 22 + 21 + 20
+ 0*2 1+0*2 2+ 1*2 3+ 1*2 4+ 1*2 5+ 1*2 6+
0* 2 7So, 0* 2
Therefore,
(3C) 16 = (011 1100)2 = (60)10
5.
Decimal to Hexadecimal Conversion
One way to convert decimal to hexadecimal
is to convert decimal to binary and then convert it to hexadecimal. Another way
is to divide successfully by 16 and writing down the remainders.
To convert decimal 2479 into hexadecimal,
divide the number by 16
The first division yields
16)2479(154
2464___
15 (15=F in Hex Form)
16)154(9
144___
10 (10=A in Hex Form)
16)9(0
0___
9 9
If we read the remainders upwards it gives
9AF
Note that remainders greater than 9 have to be changed to hexadecimal digits. Therefore decimal
2479=9AF in hexadecimal.
6.
Octal to Decimal
(4632)8 = 4* 83
+6* 82 + 3* 81 + 2* 80
= 2048 + 384 + 24 + 2
= (2458)10
No comments:
Post a Comment