Thursday, 12 December 2013

NUMBER SYSTEMS AND OPERATIONS

     
       Arithmetics for Computers (Number Systems and Operations)

        The table below shows the number when in decimal, binary and hexadecimal.
                   
                    Numeral systems conversion table

        DECIMAL                                BINARY                                  HEXADECIMAL
                  0                                0000                                       0
               1                                0001                                       1
               2                                0010                                       2
               3                                0011                                       3
               4                                0100                                       4
               5                                0101                                       5
               6                                0110                                       6
               7                                0111                                       7
               8                                1000                                       8
               9                                1001                                       9
               10                               1010                                       A
               11                               1011                                       B
               12                               1100                                       C
               13                               1101                                       D
               14                               1110                                       E
               15                               1111                                       F




How to convert from binary to decimal 


Convert binary 110011.11  to decimal:

 The decimal number is equal to the sum of powers of 2 of the binary number's '1' digits place:



1
1
0
0
1
1
.
1
1
1^5
1^4
0^3
0^2
1^1
1^0
.
1^-1
1^-2

=  (1x1^5 )+(1x1^4 )+( 1x1^1)+(1x1^0).(1x1^-1 )+(1x1^-2)

= 51.75  #

How to convert from hex to binary

Convert each 4 binary digits to hex digit  according to this table:

Bin:
0000
0001
0010
0011
0100
0101
0110
0111
Hex:
0
1
2
3
4
5
6
7

 

1000
1001
1010
1011
1100
1101
1110
1111
8
9
A
B
C
D
E
F

 

Example #1

 à Convert (01001110)2 to hex:

   (0100)2 = (4)16
   (1110)2 = (E)16
        ----------------------------------------
      (01001110)2 = (4E)16


Example #2

àConvert (0100101000000001)2 to hex:

(0100)2 = (4)16
(1010)2 = (A)16
(0000)2 = (0)16
                       + (0001)2 = (1)16
-----------------------------------------
 (0100101000000001)2 = (4A01)16  #

How to convert from hex to decimal

Example #1


E7A9 in base 16 is equal to each digit multiplied with its corresponding power of 16:

E7A916 =
E
7
A
9
14×163
7×162
10×161
9×160
57344
1792
160
9

Total = 59305
                                                                  ~ameerah~

No comments:

Post a Comment