UNIT -1
Number System
A number system is defined as a system of writing to express numbers. It is the
mathematical notation for representing numbers of a given set by using digits or
other symbols in a consistent manner. It provides a unique representation of every
number and represents the arithmetic and algebraic structure of the figures.
Number System is a method of representing numbers on the number line with the help of a
set of Symbols and rules. These symbols range from 0-9 and are termed as digits.
Types of Number System
Based on the base value and the number of allowed digits, number systems are of many
types.
The four common types of Number System are:
1. Decimal Number System
2. Binary Number System
3. Octal Number System
4. Hexadecimal Number System
Decimal Number System
Number system with base value 10 is termed as Decimal number system. It uses 10 digits
i.e. 0-9 for the creation of numbers.
Here, each digit in the number is at a specific place with place value a product of different
powers of 10. The place value is termed from right to left as first place value called units,
second to the left as Tens, so on Hundreds, Thousands, etc. Here, units has the place value
as 100, tens has the place value as 10 1, hundreds as 102, thousands as 103, and so on.
Binary Number System
Number System with base value 2 is termed as Binary number system. It uses 2 digits i.e. 0
and 1 for the creation of numbers. The numbers formed using these two digits are termed
as Binary Numbers.
Binary number system is very useful in electronic devices and computer systems because it
can be easily performed using just two states ON and OFF i.e. 0 and 1.
Decimal Numbers 0-9 are represented in binary as: 0, 1, 10, 11, 100, 101, 110, 111, 1000,
and 1001
Octal Number System
Octal Number System is one in which the base value is 8. It uses 8 digits i.e. 0-7 for
creation of Octal Numbers. Octal Numbers can be converted to Decimal value by multiplying
each digit with the place value and then adding the result. Here the place values are 8 0, 81,
and 82. Octal Numbers are useful for the representation of UTF8 Numbers.
Hexadecimal Number System
Number System with base value 16 is termed as Hexadecimal Number System. It uses 16
digits for the creation of its numbers. Digits from 0-9 are taken like the digits in the decimal
number system but the digits from 10-15 are represented as A-F i.e. 10 is represented as A,
11 as B, 12 as C, 13 as D, 14 as E, and 15 as F. Hexadecimal Numbers are useful for
handling memory address locations.
Decimal to Binary Conversion
Decimal numbers are represented in base 10, but the binary numbers are of base 2. Hence,
to convert a decimal number to binary number, the base of that number is to be changed.
Follow the steps given below:
Step 1: Divide the Decimal Number with the base of the number system to be converted
to. Here the conversion is to binary, hence the divisor will be 2.
Step 2: The remainder obtained from the division will become the least significant digit of
the new number.
Step 3: The quotient obtained from the division will become the next dividend and will be
divided by base i.e. 2.
Step 4: The remainder obtained will become the second least significant digit i.e. it will
be added in the left of the previously obtained digit.
Now, the steps 3 and 4 are repeated until the quotient obtained becomes 0, and the
remainders obtained after each iteration are added to the left of the existing digits.
After all the iterations are over, the last obtained remainder will be termed as the Most
Significant digit.
Decimal to Octal Conversion
Octal Numbers are represented in base 8. Hence, to convert a decimal number to octal
number, the base of that number is to be changed. Follow the steps given below:
Step 1: Divide the Decimal Number with the base of the number system to be converted
to. Here the conversion is to octal, hence the divisor will be 8.
Step 2: The remainder obtained from the division will become the least significant digit of
the new number.
Step 3: The quotient obtained from the division will become the next dividend and will be
divided by base i.e. 8.
Step 4: The remainder obtained will become the second least significant digit i.e. it will
be added in the left of the previously obtained digit.
Now, the steps 3 and 4 are repeated until the quotient obtained becomes 0, and the
remainders obtained after each iteration are added to the left of the existing digits.
Decimal to Hexadecimal Conversion
Hexadecimal Numbers are represented in base 16. Hence, to convert a decimal number to
hexadecimal number, the base of that number is to be changed. Follow the steps given
below:
Step 1: Divide the Decimal Number with the base of the number system to be converted
to. Here the conversion is to Hex hence the divisor will be 16.
Step 2: The remainder obtained from the division will become the least significant digit of
the new number.
Step 3: The quotient obtained from the division will become the next dividend and will be
divided by base i.e. 16.
Step 4: The remainder obtained will become the second least significant digit i.e. it will
be added in the left of the previously obtained digit.
Now, the steps 3 and 4 are repeated until the quotient obtained becomes 0, and the
remainders obtained after each iteration are added to the left of the existing digits.
Conversion from Binary to Other Number Systems
Binary Numbers are represented with digits 0 and 1 and with base 2. Conversion of a
number system means conversion from one base to another. Following are the conversion
of the Binary Number System to other Number Systems:
Binary to Decimal Conversion
Binary numbers are represented in base 2 but the decimal numbers are of base 10. Hence,
to convert the binary number into a decimal number, the base of that number is to be
changed. Follow the steps given below:
Step 1: Multiply each digit of the Binary number with the place value of that digit, starting
from right to left i.e. from LSB to MSB.
Step 2: Add the result of this multiplication and the decimal number will be formed.
Example: To convert (11101011)2 into a decimal number
Binary to Octal Conversion
Binary numbers are represented in base 2 but the octal numbers are of base 8. Hence, to
convert the binary number into octal number, the base of that number is to be changed.
Follow the steps given below:
Step 1: Divide the binary number into groups of three digits starting from right to left i.e.
from LSB to MSB.
Step 2: Convert these groups into equivalent octal digits.
Example: To convert (11101011)2 into an octal number
Binary to Hexadecimal Conversion
Binary numbers are represented in base 2 but the Hexadecimal numbers are of base 16.
Hence, to convert the binary number into Hex number, the base of that number is to be
changed. Follow the steps given below:
Step 1: Divide the binary number into groups of four digits starting from right to left i.e.
from LSB to MSB.
Step 2: Convert these groups into equivalent hex digits.
Example: To convert (1110101101101)2 into a hex number
Conversion from Octal to Other Number Systems
Octal Numbers are represented with digits 0-7 and with base 8. Conversion of a number
system means conversion from one base to another. Following are the conversions of the
Octal Number System to other Number Systems:
Octal to Decimal Conversion:
Octal numbers are represented in base 8, but the decimal numbers are of base 10. Hence,
to convert an octal number to a decimal number, the base of that number is to be changed.
Follow the steps given below:
Step 1: Multiply each digit of the Octal number with the place value of that digit, starting
from right to left i.e. from LSB to MSB.
Step 2: Add the result of this multiplication and the decimal number will be formed.
Let’s see an example.
Octal to Binary Conversion:
Octal numbers are represented in base 8, but the binary numbers are of base 2. Hence, to
convert an octal number to a binary number, the base of that number is to be changed.
Follow the steps given below:
Step 1: Write each digit of the octal number separately.
Step 2: Convert each digit into an equivalent group of three binary digits.
Step 3: Combine these groups to form the whole binary number.
Example: (247)8 is to be converted to binary
Octal to Hexadecimal Conversion:
Octal numbers are represented in base 8, but the hexadecimal numbers are of base 16.
Hence, to convert an octal number to a hex number, the base of that number is to be
changed. Follow the steps given below:
Step 1: We need to convert the Octal number to Binary first. For that, follow the steps
given in the above conversion.
Step 2: Now to convert the binary number to Hex number, divide the binary digits into
groups of four digits starting from right to left i.e. from LSB to MSB.
Step 3: Add zeros prior to MSB to make it a proper group of four digits(if required)
Step 4: Now convert these groups into their relevant decimal values.
Step 5: For values from 10-15, convert it into Hex symbols i.e from A-F
Example: (5456)8 is to be converted to hex
Conversion from Hexadecimal to Other Number Systems
Hex Numbers are represented with digits 0-9 and with letters A-F and with base 16.
Conversion of a number system means conversion from one base to another. Following are
the conversions of the Hexadecimal Number System to other Number Systems:
Hexadecimal to Decimal Conversion:
Hexadecimal numbers are represented in base 16 but the decimal numbers are of base 10.
Hence, to convert a hexadecimal number to a decimal number, the base of that number is to
be changed. Follow the steps given below:
Step 1: Write the decimal values of the symbols used in the Hex number i.e. from A-F
Step 2: Multiply each digit of the Hex number with its place value. starting from right to
left i.e. LSB to MSB.
Step 3: Add the result of multiplications and the final sum will be the decimal number.
Example: To convert (8EB4)16 into a decimal value
Hexadecimal to Binary Conversion
Hex numbers are represented in base 16, but the binary numbers are of base 2. Hence, to
convert a hexadecimal number to a binary number, the base of that number is to be
changed. Follow the steps given below:
Step 1: Convert the Hex symbols into its equivalent decimal values.
Step 2: Write each digit of the Hexadecimal number separately.
Step 3: Convert each digit into an equivalent group of four binary digits.
Step 4: Combine these groups to form the whole binary number.
Example: (B2E)16 is to be converted to binary
Hexadecimal to Octal Conversion:
Hexadecimal numbers are represented in base 16, but the octal numbers are of base 8.
Hence, to convert a hex number to an octal number, the base of that number is to be
changed. Follow the steps given below:
Step 1: We need to convert the Hexadecimal number to Binary first. For that, follow the
steps given in the above conversion.
Step 2: Now to convert the binary number to Octal number, divide the binary digits into
groups of three digits starting from right to left i.e. from LSB to MSB.
Step 3: Add zeros prior to MSB to make it a proper group of three digits(if required)
Step 4: Now convert these groups into their relevant decimal values.
Example: (B2E)16 is to be converted to hex
Binary addition “Binary Operation” represents the basic operations of mathematics that are performed on two
operands it is a base 2 system. The binary system consists of only two digits, 1 and 0
Rules of Binary Addition
Binary addition is much easier than the decimal addition when you remember the following tricks or rules.
Using these rules, any binary number can be easily added. The four rules of binary addition are:
0+0=0
0+1=1
1+0=1
1 + 1 =10
Binary Addition Table
The table of adding two binary numbers 0 and 1 is given below:
x y x+y
0 0 0
0 1 1
1 0 1
1 1 0 (where 1 is carried over)
Example 1: 10001 + 11101
Solution:
10001
(+) 1 1 1 0 1
———————–
101110
Binary Subtraction Definition
Binary numbers are a base-2 numeral system that represents data with only two symbols,
commonly 0 and 1. the subtraction of two binary digits i called as Binary Subtraction
Binary Subtraction Rules Table
Binary subtraction is easily achieved using the rules added in the table below,
Table of Binary Subtraction Rule
Binary Number Subtraction Value Rule
When we subtract 0 from 0,
0-0 0
we get 0
When we subtract 0 from 1,
1-0 1
we get 1
1 (Take 1 from the following When we subtract 1 from 0,
0-1
high-order digit) we get 1 with a borrow of 1
Table of Binary Subtraction Rule
Binary Number Subtraction Value Rule
When we subtract 1 from 1,
1-1 0
we get 0
Example 1: Subtract (1011010) 2 - (001010)2
Solution:
1011010
-001010
--------
1010000
--------
After subtracting (1011010) 2 - (001010)2 = (1010000)2