# Number System:

In every day life we encounter with objects that are to be counted and written to be understood by all. The represented number also may require addition, subtraction etc. So, number system is a way of representing the count of some objects or countable things using some well define symbols and on which some kind of operation can be performed.

Number may be called as real numbers. The real numbers is the set of numbers containing all of the rational numbers and all of the irrational numbers.  The real numbers are “all the numbers” on the number line.

All numbers can be categorized as shown in figure-1.

## Classification of Number System

These are the codes that are used in representing the information in a computer system. The classification of these codes are shown in figure-2

## Analytical Codes

These are the code whose decimal value can be calculated using the analytical relation

N=  wnx bn ………………..+……..w2x b2    +        wx b1      +       w0xbo

## Decimal System:

Decimal system has a base of 10; it use 10 symbols (0-to-9) to form any number

## Binary

Binary system uses only two symbols to represent any number. The symbols used are ‘0’ and  a ‘1’.

## Octal

Octal system has a base of 8, total of 8 symbols are used to represent any number. These are 0-to-7. Any digit greater than 7 i.e 8,9 etc are invalid in octal.

In Octal system : 0+1=1                         1+1=2                      2+1=3                      3+1=4

4+1=5                       5+1=6                       6+1 =7

7+1= 10; note since there no symbol to represent 8, so the resets to zero with a carry to make decimal 8 = 10 in octal.

Base is 16. It uses 16 symbols to represent any number. The valid symbols are 0-to-9, and ‘A’, ‘B’,’C’, ‘D’, ‘E’, ‘F’

some of the valid numbers in hexadecimal are:

B68A, 567, 1FB2, ABCD, CDEF, etc.

 Decimal Binary octal Hexadecimal 0 0000 0 –> 000 0 1 0001 1  –> 001 1 2 0010 2  –> 010 2 3 0011 3  –> 011 3 4 0100 4  –> 100 4 5 0101 5  –> 101 5 6 0110 6  –> 110 6 7 0111 7  –> 111 7 8 1000 10  –> 001 000 8 9 1001 11  –> 001 001 9 10 1010 12  –> 001 010 A 11 1011 13  –> 001 011 B 12 1100 14  –> 001 100 C 13 1101 15  –> 001 101 D 14 1110 16  –> 001 110 E 15 1111 17  –> 001 111 F

## Conversion of Number System:

### Conversion from Decimal to any other system:

Follow the procedure of division by the base to which conversion is required, Every time a division is done keep the remainder on the right. When done, read the number from bottom-to-top

Example:

Convert  :   5810 =    (                    )2

 Divisor Dividend Remainder 2 58 2 29        —————> 0 2 14       —————> 1 2 7        —————> 0 2 3        —————> 1 2 1        —————> 1 0        —————> 1

### Fraction part:

Multiplying the fraction by the base in which conversion is required. After required precession read integer values from top to bottom.

0.5510 =   0.55 x 2    =   1.10——>  1

.10 x 2     =    0.20 —>    0

58.5510 = 111010.10

## From any number system to Decimal:

For converting from any other system to decimal system require use the analytical relation

### Octal to Decimal

(567)8  =  (         )10

= 82x 5     +        8x 6      +       80x7

= 64 x 5   +     8×6           +         1×7

=  320      +      48           +          7

=  375

(AC8)16   =  (                )10

= 162x A     +        161x C      +       16x 8

= 256 x 10  +       16 x 12      +        1×8

= 2560        +          192         +        8

=  2760

### Binary to Decimal

Convert (11011)2 to decimal

24x1    +     23x1    +      22x0     +        21x 1      +       20x1

= 16    +     8         +      0            +       2             +      1

=2710

### Convert 101.101 to Decimal

=22x1  + 21x0  + 20x1       .  2-1x1  +  2-2x0    +  2-3x1

=     4        +    0    +   1      .    0.5   + 0           + 0.125

= 5.625

### Convert (A29C)16 to Decimal

=    163xA   +  162x2   +  161x9    +  160xC

=    4096×10  + 256×2  + 16×9   +  1×12

=    40960    + 512        + 144     + 12

=    (41628)10

## Alphanumeric Code

### (ii)American Standard Code for Infromation Interchange (ASCII)

The EBCDIC is used by IBM computer systems

The ASCII is used by almost all other computer systems.

In either case, the information that we feed to a computer system or extract some information out of the computer is alphanumeric i.e. in the form of letters, digits or some other special symbols.

ASCII format is a standard format commonly used as alphanumeric code. Its usage allows the manufacturers to standardize the i/o hardware such as KB, printer, display units etc. The ASCII code is of 7-bit or 8-bit format. With 7-bit format we can have 128 different codes. The table below shows the ASCII 7-bit code.

 High bits 6,5,4, Lower 4 bits of ASCII Code (3,2,1,0) 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 000 nul soh stx etx eot enq ack bel bs ht lf vt ff cr so si 001 dle dc1 dc2 dc3 dc4 nak syn etb can em sub esc fs gs rs us 010 SP ! “ # \$ % & ‘ ( ) * + ‘ – . / 011 0 1 2 3 4 5 6 7 8 9 : ; < =. > ? 100 @ A B C D E F G H I J K L M N O 101 P Q R S T U V W X Y Z [ \ ] ^ _ 110 ` a b c d e f g h i j k l m n o 111 p q r s t u v w x y z { | } ~ del

We can easily trace the ASCII code for any digit, letter and printable characters from the table. The rows of the table gives 3-most significant bits of the ASCII code and column gives the lower 4-bits, thus we get an equivalent 7-bit code of any printable ASCII code.
Numbers are transmitted to and from a computer as a sequence of ASCII-code digits. The number for example 234 would be transmitted as 32, 33, 34. Code of ‘A’ is 41h while that of ‘a’ is 61h

The code may be stored without modification, in which case the number will be in unpacked BCD format; or two digits can be packed together by stripping the high order; or it may convert the number to binary format. The choice of the format depends on the requirement of the program that will use this data.