0% found this document useful (0 votes)
19 views

CH-1 book

The document provides an overview of number systems, including Decimal, Binary, Octal, and Hexadecimal, explaining their bases and how they represent numbers. It details the conversion methods between decimal and binary numbers, as well as basic arithmetic operations in binary. The document emphasizes the importance of understanding these systems for computer programming and data manipulation.

Uploaded by

mca2023081
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

CH-1 book

The document provides an overview of number systems, including Decimal, Binary, Octal, and Hexadecimal, explaining their bases and how they represent numbers. It details the conversion methods between decimal and binary numbers, as well as basic arithmetic operations in binary. The document emphasizes the importance of understanding these systems for computer programming and data manipulation.

Uploaded by

mca2023081
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Number Systems

Do you know that a computer cannot Let's Learn About


understand the language that you speak? " Decimal Number System
It understands only machine language. " Binary Number System
Every letter or symbol that you write as Octal Number System
instructions to a computer gets converted " Hexadecimal Number System
into machine language. A machine " Conversions in Number
language comprises of numbers. System
In order to understand the language used " Computer Arithmetic
by computers, it is important to understand
number system. Let us learn about
different number systems in this chapter.

You use numbers to perform different calculations. To make calculations easy, different number
systems were invented. A number system is amathematical way to represent numbers. There
are primarily four types of number systems-Decimal, Binary, Octal, and Hexadecima.

DECIMAL NUMBER SYSTEM


The decimal number system consists of digits 0-9. These 10 digits can be used in any
combination to form a number. Some examples of decimal numbers are 608, 1711, 124,
456, and so on.
The base of decimal numbers is 10 because total digits in this number system are 10.
Base can be defined as the number of digits which are available in the number system for
expressing any digit in that particular number system.
The decimal number system is a positional value system. The value of each digit is based on
its position in a number. lIt is also called the positional value notation,

Info Box »>>» 7


The base of a number system is placed asa subscript of a number.
lot us understand the concept of value with the help of the following examplee:
Example 1: Find the value of number 231.
Solution:
Number Power of base Calculation
1 1 X 100
Value
1x 1
3 3× 10! 3 × 10 30
2 2 x 102 2 x 100 200
Total value = 200 + 30 + 1 = 231

Explanation: The position of the rightmost digit is ones position or units


the number is multiplied by 10raised to the position. Therefore
power O which is equal to 1. As yoU move
towards the left, the position of the digits is tens,
of the power for each digit increases by 1 when yoU
hundreds, thousands, and so on. The volue
move from right to left.
In the above example, notice number 231. Here,
1is at ones position. Therefore, it is
multiplied by 10 raised to the power 0.
3 is at tens position. Therefore, it is
multiplied by 10 raised to the power 1.
2 is at hundreds position. Therefore, it is
multiplied by 10 raised to the power 2.

Ava's Cool Tip >


Apower value is solved by multiplying the digit by itself, the number of times the value of power is.
In Example 1, 10' implies only 1 unit of 10. 10² implies 10 multiplied 2 times which is equal to 100.
Remember, 10° is always equal to 1.

Example 2: Find the value of number 345.


Solution:
Number Power of base Calculation Value
5 5 x 10o 5 X 1 5
4 X 10! 4 X 10 40
3 3 x 102 3× 100 300
Total value = 300 + 40 + 5 = 345
8 These two examples show how the decimal number system works. The value of each dlg"
increases by 10 times as you move from right to left.
Ava's Practice Time
Expand the number 38.12.
Solution:

As you can see, the number 38.12 contains a decimal point that separates the whole
number into two parts. Hence, you can expand it as:
Number Power of base Calculation Value
2 2 x 102 2 x 1/100 0.02
1 1x 10-! 1 x 1/10 0.1
8 x 100 8 x 1 8
3 3 x 10' 3 x 10 30

Total value = 30 + 8+ 0.1l + 0.02 =38.12

BINARY NUMBER SYSTEM


Unlike the decimal number system, the binary number system consists of only two
numbers-0and 1. Some examples of binary numbers are 11101, 10111, 1010, and so on.
The base of binary number system is 2 because the total digits in this number system are two.
The positional values of the digits of a binary number correspond to powers of 2. Starting
from the right, the first digit is in the units position or ones posiftion. Therefore, the positional
value starts from 20.

Example:
Binary number 1
Positional value 2° 2 2' 20

Any data or instructions entered in a computer is converted into binary form because a
computer understands only machine language. A machine language consists of binary digits.
The binary digit 1 means CON and the binary digit 0 means OFF.

OCTAL NUMBER SYSTEM


A number system whose base is 8 is known as the octal number system. The base 8 means
the system uses eight digits from 0 to 7, i.e. any number can be writen using combination of
the eight digits of this system.
9
The octal number system is also a positional number system. Allthe eight digits from 0 to 7 have
the some physical meaning as that of decimal numbers which are expressed as a power of 8.
Info Box »»»
Otal number system was extensively used in early mainframe computer systens, but it has become
less popular today in comparison to binary and hexadecimal number systems.

HEXADECIMAL NUMBER SYSTEM


The hexadecimal number system consists of ten digits from 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 and
six letters A, B, C, D, E, F. The letters A, B, C, D, E, F represent 10, 11, 12, 13, 14, 15,
respectively. The base of the hexadecimal number system is 16 as in this number system
16 elements are available.

Allthe other numbers can be expressed by combining these digits and letters. The
hexadecimal number system is used mostly in microprocessors and microcontrollers.

CONVERSION OF DECIMAL NUMBERS TO BINARY NUMBERS


The division method is used to convert decimal numbers into binary numbers. To convet
a decimal number into a binary number, follow these steps:
1. Divide the decimal number by 2 (2 is the base of the binary number system).
2. Write the remainder to the right of the dividend. As we are converting a number into its
binary equivalent, the remainder will be 0 for even numbers, and 1for odd numbers.
3. The quotient becomes the dividend for the next division. Keep dividing the quotient
by 2 until it becomes 0.
4. Write the remainders in reverse order to get its binary equivalernt.
Let us understand the conversion of decimal to binary with the help of examples.
Example 1: Convert the decimal number (33),, into a binary number.
Solution:
2 33
2 16
2
4 Write the remainders in reverse
order to get a binary number
2 2
2 1
2
10
Thus, (33),o =(100001),
Example 2: Convert the decimal number (256), into a binary number.
Solution:
256
2 128
oeldoleleoldl
2 64
32
2 16
2 8 Write the rernginders in reverse
order to get a binary nurnber
2 4
2 2
2 0
2

Thus, (256),, = (100000000),

Ava's Prectice Time


Convert the decimal number (205), into a binary number.
Solution:
2 205
2 102

-el-lelll
2

2
51
25
12 Write the rermainders in reverse
2 6 order to get a binary number
2 3
2
2 0

Thus, (205),= (11001101),

cONVERSION OF BINARY NUMBERS TO DECIMAL NUMBERS


The multiplication method is used to convert binary numbers into decimal numbers.
To convert a binary number into a decimal number, follow these steps:
1. First, give powers of 2 in increasing order, starting from 0, and from right-to-left.
2. Multiply each digit by base 2 and the power of its positional value. 11
3. Add all digits to get the decimal number.
Example 1:Convert the binary number (1 101), into a decimal number.
Solution:
(101), = (1 x 29) + (1 x22) + (0 x 2') + (1 x 20)
= (1 x 8) + (1 x 4) + (0 x 2) + (1 x 1)
= (8) + (4) + (0) + (1)
= 13

Thus, (1101), = (13),0


Example 2: Convet the binary number (1101110), into adeimal number.
Solution:

(701110), =(1 x 2) + (1x 29) + (0 x2) + (1 x 29) + (1 x2) + (1 x 2) + (0 x 29)


= (1 x64) + (1 x 32) + (0 x 16) + (1 x 8) + (1 x 4) + (1 x 2) + (0 x 0)
= (64) + (32) + (8) + (4) + (2)
= 1]0

Thus, (1101110), =(110),0

Ava's Practice Time


Convert the binary number (01110), into a decimal number.
Solution:
(01110), = (0 x 24) + (1 x 29) + (1 x 22) + (1 x 2") + (0 x 2°)
= (0 x 16) + (1 x 8) + (1 x4) + (1 x 2) + (0 x 1)
= (0) + (8) + (4) + (2) + (0)
= 14

Thus, (01110), = (14),0

Let's Review >>>>


Complete the sentences.
1 The binary number system consists of
2. The decimal number system is a
3. The multiplication method is used to
4. Anumber system whose base is 8 is known as
COMPUTER ARITHMETIC
In digtal computers, data is manipulated by using arithmetic instructions. Data is manipulated
to produce necessary results to give solution for computation problems. Addition, subtracion,
multiplication, and division are the four basic arithmetic operations.
Binary Addition
Binary addition includes the addition of only two digits, i.e. l and 0. The addition of the
binary digits depends on the following four basic combingtions:
AB A+ B =C Carry over
0 0 0 +0 = 0 No carry over
0 1 0 + 1 =1 No carry over Ava's Cool Tip >>>>»
In binary addition, the output of 1+ 1= 10,
1 0 1+0 =1 No carry over where 0 is written under the same column and
1 1 |+ 1 =0 Carry over l 1carried over to the next position.

Let us understand binary addition with the help of the following examples:
Example 1: Add (11101), and (1 1011),.
Solution:
1 1 1 1 1 Carry over
11 1
1 1
1 1

Explanation: The detailed calculation of Example 1 starts from the digits at the units position.
1+1= 10 = 0 with a carry over of 1.
1+0 + 1= 10 = 0 witha carry over of 1.
1+ 1+ 0= 0 with 1carry + 0 = 10 + 0=0 with a carry over of 1.
1 +1 + 1 =0 with 1carry + 1= 10 + 1 =lwith a carry over of 1.
1+ 1+ |=0 with 1carry + 1= 10+ 1= 1with a carry over of 1.
Thus, (11101), + (11011), = (11100),
Example 2: Add (1000), and (101),. Example 3: Add (1010), and (111),
Solution: Solution: 1 1 1 Carry over
10 0 0 101
+
1 0 1 11 1 13
= | 10 1 = 1 00 0 1
Binary Subtraction
1and 0. The subtraction of
Binary subtraction includes the subtraction of only two digits, i.e.
the binary digits depends on the following four basic combinations:
A B A - B =C BorroW
0-0 = 0 No borrow Ava's Cool Tip >>>>
1 0 1- 0 = 1 No borrow Like decimal subtraction, the number is
borrowed from the next position when 1
No borrow is subtracted from 0 (10 -l= 1),
0-1 = 1 Borrow 1

Let us understand bingry subtraction with the help of following examples.


Example 1: Subtract (1010), from(1100),.
Solution:
Borrowed 1

10-1
40

0 1

Explanation: The detailed calculation of the above example starts from the digits at the units
position.
0-0 = 0
0-1 = 1, borrow l and then it becomes, 10 1 = 1.
Now for l 0, 1has already been given, hence, it becomes 0 - 0= 0. Now, 1 -1 =0
Thus, (1100), - (1010), = (0010),
Example 2: Subtract (1010), from (1111),.
Solution: 1 1 1 1
1 1
0 1

Example 3: Subtract (11), from (1100),


Solution: Borrowed 1
Borrowed 1
10 10-1
1 +0
14
Ava's Practice Time
Solve the following:
1. (1010), + (1), 2. (10001), + (11101),
Solution:
3. (1011011), - (10010),
Solution: Solution:
1
10 1 0 10 0 01
11 101 1 0 1 1
111 01 100 1 0
= 11 0 1 = | 011 10 1 0 0 1 0 01

Flashback
The base of decimal numbers is 10 because the total digits in this
number system are ten (0-9).
The binary number system consists of only two numbers-0 and 1. The base of this
number
system is 2.
The octal number system consists of 8 digits. The base of this number system is 8.
The hexadecimal number system includes 16 elements-0 to 9 and A to E The letters A to F
represent 10, 11, 12, 13, 14, 15, respectively.
The division method is used to convert decimal numbers into binary numbers.
The multiplication method is used to convert binary numbers into decimal numbers.

Exercises
A. Tick () the correct answers.

1. Which of these number systems has only two digits?


Decimal b. Binary C. Hexadecimal
2. Which of these means OFF in the binary number system?
a. 1 b. 0 C. -1
3. Which of these is the rightmost position in a positional number system?
a. Ones b Units C Both a and b
4 Which of these number systems has the base 16?
a. Decimal b Binary C. Hexadecimal
15
5. Which method is used to convert a binary number into a decimal number?
a. Division b. Multiplication C. Addition
B. Fill in the
blanks.
1, The decimal number system consists of digits to

2. The base of the octal number system is


3. The binary digit means ON.
4. The method is used to convert binary numbers into decimal numbers
5. The hexadecimal number system is used in and
C. Write T for True andF for False.
1. The base of thehexadecimal number system is 7.
2. (1231), is an example of decimal
number.
3. A
computer understands only machine language.
4. In
binary addition, output of 0+1 is 0.
5.
You borrow a digit from the next position
when you subtract 1 from 0.
D. Answer the
following questions.
1. What is a
number system? List different types of number
systems.

2. Explain the decimal number system.

3. Describe the binary number system.

16
4. Distinguish between octal and hexadecimal number systems.

5. How do you convert a binary number into a decimal number? Describe.

Ava's Activity Zone

whether the following numbers are decimal or binary.


A. State
1. (5841.44)0
2. (101),
3. (1542),0
4. (110109),0
5. (1111), binary equivalent. Help her with
its
convert the decimal number 233 into
B. Neha wants to
the calculation.

Solution:

17

You might also like