Number System


bit  - a binary digit, the smallest increment of data on a computer
        - can hold only one of two values: 0 or 1, corresponding to the electrical values of off
          or on, respectively.
 
 
byte  - the smallest addressable unit for a CPU.


word  - the natural size with which a processoris handling data(the register size).
            - most common word sizes encountered today are 8, 16, 32 and 64 bits, but other sizes are possible.


nibble  - sometimes spelled "nibble," is a set of four bits.
               - since there are eight bits in a byte, a nybble is half of one byte.                
              - in the computer world, two nybbles always equal one byte.






Types of Number System

1. Binary System
It is a number system with base digits 0 or 1.It can be written as subscripted B or 2.For example:(1001)B or (1001)2

….20 = 1, 21 = 2, 22 = 4, 23 = 8, 24 = 16.....


2. Decimal Number System
It is number system with base 10 and use digits 0 to 9.It can be written as subscripted D or 10.For example:(158)10 or (268)D.

.....100 = 1, 101 = 10, 102 = 100, 103 = 1000.....

3. Hexadecimal  Number System
It is a number system with base 16 and use digits 0 to 9 and symbols A to F.It can be written as subscripted 16 or H.For example:(2AB)H or (ABC)16.

..... 160=1,161 =16,162=256,163=4096…..

 
Converting from One System to Another
Other bases into decimal




Decimal
Binary            
Hexadecimal
(base 10)
(base 2 )           
       (base 16)
0
0
0
1
1
1
2
10
2
3
11
3
4
100
4
5
101
5
6
110
6
7
111
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




 

Decimal:





45297 =
4 * 104 = 4 * 10,000 = 40,000
5 * 103 = 5 *  1,000  =   5,000
2 * 102 = 2 *    100   =     200
9 * 101 = 9 *     10    =       90
7 * 100 = 7 *      1     =         7
                                     45297

Other bases into the decimal system:





Binary
Hex
11011101 =
1 * 27 = 1 * 128 = 128
1 * 26 = 1 *   64 =  64
0 * 25 = 0 *   32 =   0
1 * 24 = 1 *   16 =  16
1 * 23 = 1 *     8 =   8
1 * 22 = 1 *     4 =   4
0 * 21 = 0 *     2 =   0
1 * 20 = 1 *     1 =   1
                           221
285BCE =
2 * 165 =   2 * 1,048,576 = 2,097,152
8 * 164 =   8 *     65,536 =    524,288
5 * 163 =   5 *       4,096 =      20,480
B * 162 = 11 *          256 =       2,816
C * 161 = 12 *           16 =          192
E * 160 = 14 *             1 =           14
                                         2,644,942

·         Convert 1011001012 to the corresponding base-ten number.




I will list the digits in order, and count them off form the RIGHT, starting with zero:
 
 digits : 1 0 1 1 0 0 1 0 1

                  numbering: 8 7 6 5 4 3 2 1 0
 
(1 x 28)+(0 x 27)+(1 x 26)+(1 x 25)+(0 x 24)+(0 x 23)+(1 x 22)+(0 x 21)+(1 x 20)
= (1 x 256)+(0 x 128 )+(1 x 64)+(1 x 32)+(0 x 16)+(0 x 8)+(1 x 4)+(0 x 2)+(1 x 1)
=256 + 64 + 32 + 4 + 1
= 357
                                                                                                                                                                                                         Then 1011001012 = to 35710.

·         Convert 16516 to the corresponding decimal number.

List the digits, and count them off from the RIGHT, starting with zero:

digits:  
1  6   5
numbering:  
2  1   0

Remember that each digit in the hexadecimal number represents how many copies you need of that power of sixteen, and convert the number to decimal:

1×162 + 6×161 + 5×160
     = 1×256 + 6×16 + 5×1

     = 256 + 96 + 5

     = 357

Then 16516 = 35710.
 
Decimal to Binary Or Hex
 
let's convert 22110 into binary.
   110 r 1
2)221

The remainder becomes the rightmost digit in our answer; the quotient is used for the next dividend. Because we are converting to binary, 2 is our divisor.
 
    55 r 0
2)110

Now 0 is pre-pended to the 1 we got before. And we repeat our divisions until the quotient is 0.
 
I find it easier to start at the bottom and stack up my divisions, keeping track of my remainders. Read this example as a series of divisions from the bottom up, but read the conversion as the list of remainders from the top down.
      0     r 1
  2 )1     r 1  
  2 )3     r 0
  2 )6     r 1  
  2 )13   r 1  
  2 )27   r 1  
  2 )55   r 0  
  2 )110 r 1   
  2 )221


The answer is read from the top to the bottom using the remainders: 11011101.

_______________________________________________________________________________


To convert from decimal to hex, divide by 16 and remember to convert the remainder into hex digits (0-F). For example, let's convert 264494210 into hex.
 
          ­­­­ 0          r 2
    16 )_2         r 8     
    16 )40         r 5    
    16 )645       r 11 (B)     
    16 )10331   r 12 (C)    
    16 )165308 r 14 (E)    
    16 )2644942

The answer is read from the top to the bottom: 285BCE
 
 
·         Convert 35710 to the corresponding hexadecimal number.
 Here, I will divide repeatedly by 16, keeping track of the remainders as I go. (You might want to use some scratch paper for this.)
      1      r 6
16)22     r 5
16)357    
 
   
Reading off the digits, starting from the top and wrapping around the right-hand side, I see that 35710 = 16516
 
 
·         Convert 6393310 to the corresponding hexadecimal number


I will divide repeatedly by 16, keeping track of my remainders:




­­­­            15 r 9
16 )    249 r 11 (B)   
16 )  3995 r 13 (D)   
16 )63933     
 
 
I cannot write the hexadecimal number as “1591113”, because this would be confusing and imprecise. So I will use the letters for the “digits” , let “F” = “15”, “B” = “11”, and “D” =”13”.

Then 6393310 = F9BD16.





 


0 comments:

Post a Comment

 
Copyright © ComPutEr???