CBSE-XI-CS-Number System

 

Number System

 

As humans we have been counting for a long time. We use numbers 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 for this purpose. This system of numbers that we are using has 10 symbols to form all numbers and to do all calculations. This system of Numbers is called Decimal Number system.

 

In the same way, there can be many other number systems like a computer can understand only 0 and 1. So there are two symbols used in the number system used by a computer and all the numbers are formed by using these two symbols i.e., 0 and 1. This system of numbers is called Binary Number System.

 

It means a number system is a way of representing numbers using ‘n’ different symbols and digits. Where n is called the base or the radix of the number system. The main properties of a number system are

1.     The Base (Radix): The total number of digits or symbols used in the number system (for ex, 10 is the base of decimal number system)

2.     Numbers: The numbers used in the number system

3.     The Position: Position of each number from right to left.

 

There are 4 major types of number systems that we are going to study about:

1.     Decimal Number system

2.     Binary Number system

3.     Octal Number system

4.     Hexadecimal Number system

 

Decimal Number System:

Decimal number system can contain digits from 0 to 9. It means 10 symbols are used in this number system, so base of decimal number system is 10. Decimal numbers are represented with 10 as subscript to the value. Examples of decimal numbers are: (1234)10, (55.34)10

 

Binary Number System:

Binary number system can contain digits 0 and 1. It means 2 symbols are used in this number system, so base of Binary number system is 2. Every digit is referred to as a bit. A collection of 8 bits is called a Byte.

 

1 byte              = 8 bits

1 Kilobyte        = 1024 bytes

1 megabyte     = 1024 kilobyte

1 gigabyte       = 1024 megabyte

1 terabyte        = 1024 gigabyte



Binary numbers are represented with 2 as subscript to the value. Examples of binary numbers are: (1011)2, (101.11)2

Binary Numbers Table

Some of the binary notations of lists of decimal numbers from 1 to 30, re mentioned in the below list.

Number

Binary Number

Number

Binary Number

Number

Binary Number

1

1

11

1011

21

10101

2

10

12

1100

22

10110

3

11

13

1101

23

10111

4

100

14

1110

24

11000

5

101

15

1111

25

11001

6

110

16

10000

26

11010

7

111

17

10001

27

11011

8

1000

18

10010

28

11100

9

1001

19

10011

29

11101

10

1010

20

10100

30

11110



Octal Number System:

Octal number system can contain digits 0, 1, 2, 3, 4, 5, 6 and 7. It means 8 symbols are used in this number system, so base of octal number system is 8. Octal numbers are represented with 8 as subscript to the value. Examples of octal numbers are: (1234)8, (55.34)8

 

Hexadecimal Number System:

Hexadecimal number system can contain digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E and F. where

A=10

B=11

C=12

D=13

E=14

F=15

It means 16 symbols are used in this number system, so base of hexadecimal number system is 16. Hexadecimal numbers are represented with 16 as subscript to the value. Examples of hexadecimal numbers are: (2A4)16, (55.34)16

 

Number System

Base

Digits used

Representation

Binary

2

0 and 1

(10010)2

Decimal

10

0 to 9

(199)10

Octal

8

0 to 7

(234)8

Hexadeimal

16

0 to 9, A to F

(2DEF)16

 

 

 

Number System Conversions

 

The following types of conversions we are going to study

1.     From Any other number system to Decimal number system

2.     From Decimal to Any other number system

3.     From Octal or Hexadecimal to Binary Number System

4.     From Binary to Octal or Hexadecimal Number System

 

From Any other number system to Decimal number system

 

1. From Binary Number System to Decimal Number System

To obtain decimal equivalent of a binary number, individual digits of binary number should be multiplied by powers of 2 starting with rightmost digit multiplied by 20, second last digit multiplied by 21, third last digit multiplied by 22 and so on upto the leftmost digit.

 

Example 1:

(1011)2 = (?)10



 

 

Most Significant Bit (MSB) = leftmost bit

Least Significant Bit (LSB) = rightmost bit


1

0

1

1

 

1 x 23

+

0 x 22

+

1 x 21

+

1 x 20

=

11

 

Therefore:

(1011)2 = (11)10                                       

https://ir-in.amazon-adsystem.com/e/ir?t=love2800-21&l=ur2&o=31

Example 2:

(11011.011)2 = (?)10

 

24 x 1 + 23 x 1 + 22 x 0 + 21 x 1 + 20 x 1 + 2-1 x 0 + 2-2 x 1 + 2-3 x 1

= 16 + 8 + 0 + 2 + 1 + 0 + 0.25 + 0.125

= 27.375

 

2. From Octal Number System to Decimal Number System

To obtain decimal equivalent of an octal number, individual digits of octal number should be multiplied by powers of 8 starting with rightmost digit multiplied by 80, second last digit multiplied by 81, third last digit multiplied by 82 and so on upto the leftmost digit.

 

Example 1:

(127)8 = (?)10

 

 

1 x 82

+

2 x 81

+

7 x 80

=

87

 

Therefore:

(127)8 = (87)10                                       

https://ir-in.amazon-adsystem.com/e/ir?t=love2800-21&l=ur2&o=31

Example 2:

(127.5)8 = (?)10

82 x 1 + 81 x 2 + 80 x 7 + 8-1 x 5

= 64+ 16 + 7+ 0.625

= 87.625

 

3. From Hexadecimal Number System to Decimal Number System

To obtain decimal equivalent of a hexadecimal number, individual digits of hexadecimal number should be multiplied by powers of 16 starting with rightmost digit multiplied by 160, second last digit multiplied by 161, third last digit multiplied by 162 and so on upto the leftmost digit.

In case of alphabets A to F, codes of alphabets should be multiplied by power of 16.

 

Example 1:

(127)16 = (?)10

 

 

1 x 162

+

2 x 161

+

7 x 160

=

295

 

Therefore:

(127)16 = (295)10                                       

https://ir-in.amazon-adsystem.com/e/ir?t=love2800-21&l=ur2&o=31

Example 2:

(A29)16 = (?)10

 

 

A x 162

+

2 x 161

+

9 x 160


10 x 162

+

2 x 161

+

9 x 160


10 x 256

+

2 x 16

+

9 x 1


2650

+

32

+

9


2691

 

 

Therefore:

(A29)16 = (2691)10                                       

 

Example 3:

(1B7.5)16 = (?)10

 

(1B7.5)16

= 162 x 1 + 161 x B + 160 x 7 + 16-1 x 5

= 256 + B + 7+ 0.3125

= 256 + 11 + 7 + 0.3125

= (274.3125)10

 

From Decimal number system to Any other number system

 

1. From Decimal Number System to Binary Number System

 

Example1:

(17)10 = (?)2 = (10001)2

 

 



Example2:

 



2. Decimal to octal Conversion

 



 

 3. Decimal to hexadecimal Conversion


 

https://ir-in.amazon-adsystem.com/e/ir?t=love2800-21&l=ur2&o=31

Octal to Binary Conversion

Example

For example, to get binary equivalent of octal number 127 we can take following steps:

Binary equivalent of 7 is 111

Binary equivalent of 2 is 010

Binary equivalent of 1 is 001

So Binary equivalent of (127)8 is:


1

2

7

001

010

111

(001010111)2

Hexadecimal to Binary Conversion

For example, to get binary equivalent of hexadecimal number A27 we can take following steps:

Binary equivalent of 7  is 0111

Binary equivalent of 2 is 0010

Binary equivalent of A(10) is 1010

So Binary equivalent of (A27)16 is:


A

2

7

10

2

7

1010

0010

0111

(101000100111)2

Binary to octal Conversion

For example, to get octal equivalent of binary number 101011 we can take following steps:

101011 is divided into groups of three digits as:

(101)(011)

Decimal equivalent of 011 is 3

Decimal equivalent of 101 is 5

Octal equivalent of 1010112 is:

101

011

5

3

(53)8


Binary to Hexadecimal Conversion

For example, to get octal equivalent of binary number 1011101011 we can take following steps:

1011101011 is divided into groups of four digits as:

(0010)(1110)(1011)  

Note: zeros are filled at the beginning of left most group of binary digits if there are lesser number of digits than four.

Decimal equivalent of 1011 is 11 (B)

Decimal equivalent of 1110 is 14 (E)

Decimal equivalent of 0010 is 2

Hexadecimal equivalent of 10111010112 is:



0010

1110

1011

2

14

11

2

E

B

(2EB)16



Binary Addition

Binary numbers can be added just like normal numbers but in case of binary numbers sum is always 0 or 1. Rules of adding binary numbers are:

1.   0+0=0

2.   0+1=1

3.   1+0=1

4.   1+1=0 with carry 1

5.    Example 1:


Carry

 

1

1

1

1

 

 

 

1

1

1

0

1

+

 

1

1

0

1

1

=

1

1

1

0

0

0

 

Sum in above example is performed by following steps:

1 + 1 = 10 = 0 with carry 1.

1+0+1 = 10 = 0 with carry 1

1+1+0 = 10 = 10 = 0 with carry 1

1+1+1= 10+1 = 11= 1 with carry 1

1 +1 +1 = 11

 

Example 2:


 

Carry

 

1

1

 

 

 

0

0

1

1

0

+

0

0

0

1

1

=

0

1

0

0

1

 

 

ASCII, ISCII and Unicode

ASCII, ISCII and Unicode are encoding languages with unique characteristics that define their usage.

 

ASCII

·        ASCII stands for American Standard Code for Information Interchange

·        ASCII uses a 7-bit encoding

·        There are 128 character codes in ASCII character set

·        Some values:

o   A to Z: 65 to 90

o   A to z: 97 to 122

o   0 to 9: 48 to 57


Unicode:

·        Unicode stands for Universal Coding System.

·        Unicode uses 16-bit encoding.

·        It gives a code point for more over than 65000 characters.

·        It provides every character a special numeric value as well as a name.

·        It provides encode all the characters used for writing for almost all languages which is used all over the world.


ISCII:

·        ISCII stands for Indian Standard Code for Information Interchange.

·        8-bit code is used in ISCII code  

·        It contains the general alphabet which is essential for the ten Indian script

·        It is originated from Brahmi script.

 

Comments