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

Ch-06 (Comp) - Number System

The document discusses different number systems including decimal, binary, octal, and hexadecimal. It provides details on: 1) How each number system works including the base and value of each digit based on its position. 2) Methods for converting between decimal, binary, octal, and hexadecimal numbers which involve dividing or multiplying by the base to determine each digit place value. 3) Octal and hexadecimal numbers can be easily converted to and from binary using conversion tables that group digits by the place value in each system.

Uploaded by

mana g
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)
102 views

Ch-06 (Comp) - Number System

The document discusses different number systems including decimal, binary, octal, and hexadecimal. It provides details on: 1) How each number system works including the base and value of each digit based on its position. 2) Methods for converting between decimal, binary, octal, and hexadecimal numbers which involve dividing or multiplying by the base to determine each digit place value. 3) Octal and hexadecimal numbers can be easily converted to and from binary using conversion tables that group digits by the place value in each system.

Uploaded by

mana g
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/ 25

INTRODUCTION TO COMPUTER

Chapter 6
Number System
Contents
• Number System
• Conversion from Decimal to other Number System
• Octal Number to Binary Conversion
• Hexadecimal Number to Binary Conversion
• Binary Arithmetic
Number System
Chapter 6 – Number System
Number System
• A system for representation of numeric data is called number system
• Most popular example of a number system is the decimal number system
• In this number system, each number can consist of digits from 0 to 9
• Total number of digits in any number system is called it's base or radix
• Most commonly used number systems
• Decimal number system
• Binary number system
• Octal number system
• Hexadecimal number system
• Decimal number system is used in our daily life
• Binary number system is used in digital computers
• Hexadecimal number system and octal number system are also used in
computer system
Decimal Number System
• Decimal number system is used in our daily life
• Base of decimal number system is 10 because this number system consists of
10 digits from 0 to 9
• Value of each digit of a decimal number depends upon the following:
• Position of the digit in the number
• Face value of a digit, i.e. the digit itself
• Weight of digit with respect to its position
• Each position represents a specific power of base 10
• Position of the first digit at the right side of the number is 0, the second digit is
1, the third digit is 2, and so on.
• In case of a fractional number, first digit towards the right side of the decimal
point is at position –1, the second is at position –2, and so on.
• Suppose an integer number is 47859
Decimal Number System
Example 1
• Consider the decimal number 892
• Value of each digit of number 892 is calculated as:
8  8  102 = 800
9  9  101 = 90
2  2  100 = 2 (100 = 1)
• Adding these values: 800 + 90 + 2 = 892
Example 2
• Consider the number with fractional part 139.78
• Value of each digit of number 139.78 is calculated as:
1  1  102 = 100
3  3  101 = 30
9  9  100 = 9 (100 = 1)
7  7  10-1 = 0.7
8  8  10-2 = 0.08
• Adding these values: 100 + 30 + 9 + 0.7 + 0.08 = 139.78
Binary Number System
• Binary number system consists of only two digits 0 and 1
• These digits are called binary digits
• Base of binary number system is 2
• Digital computers use binary system to represent or store all types of data
• Like decimal number system, in binary number system also, position of digits
is very important
• Each position represents a specific power of base 2
• Position of first digit at the right side of the number is 0, the second digit is 1,
the third digit is 2, and so on.
• Positional value of each digit in the binary number system is twice the
positional value of the digit of its right side
Binary Number System
Binary to Decimal Conversion
• Write down the given binary number and represent the position of each digit with a
power of 2. Suppose the binary number is (1011)2
• In this case, the power of 2 begins from 0 and ends at 3
• Multiply the corresponding powers of 2 to each binary digit of the given binary
number
1  1  23
0  0  22
1  1  21
1  1  20
• Compute the value of each digit of the given binary number
1  1  23 = 1  8 = 8
0  0  22 = 0  4 = 0
1  1  21 = 1  2 = 2
1  1  20 = 1  1 = 1
• Add all the values: 8 + 0 + 2 + 1 = 11
• Write the answer with base 10 as subscript: (1011)2 = (11)10
Binary Number System
Binary to Decimal Conversion
Example 1
• Convert (101011)2 into decimal number
(101011)2 = 1  25 + 0  24 + 1  23 + 0  22 + 1  21 + 1  20
= 1  32 + 0  16 + 1  8 + 0  4 + 1  2 + 1  1
= 32 + 0 + 8 + 0 + 2 + 1 = 43
(101011)2 = (43)10
Example 2
• Convert (11.011)2 into a decimal number
(11.011)2 = 1  21 + 1  20 + 0  2-1 + 1  2-2 + 1  2-3
= 1  2 + 1  1 + 0  1/2 + 1  1/4 + 1  1/8
= 2 + 1 + 0 + 0.25 + 0.125
= 3 + 0.375
= 3.375
(11.011)2 = (3.375)10
Octal Number System
• Octal number system consists of 8 digits from 0 to 7
• Base of octal number system is 8
• Any digit in this number system is always less than 8
• Number (777)8 is valid
• Number (778)8 is not valid because digit 8 is not a member of this number
system
• Other rules are the same as for binary number system
Octal Number System
Example 1
• Convert (236)8 into a decimal number
(236)8 = 2  82 + 3  81 + 6  80
= 2  64 + 3  8 + 6  1
= 128 + 24 + 6 = 158
(236)8 = (158)10

Example 2
• Convert (23.6)8 into a decimal number
(23.6)8 = 2  81 + 3  80 + 6  8-1
= 2  8 + 3  1 + 6  1/8
= 16 + 3 + 0.75 = 19.75
(23.6)8 = (19.75)10
Hexadecimal Number System
• Hexadecimal number system consists of 16 digits from 0 to 9 and A to F
• Decimal values of A, B, C, D, E, and F are 10, 11, 12, 13, 14, and 15 respectively
• Base of the hexadecimal number system is 16
• For example, 3F2B and 723 are hexadecimal numbers
• Hexadecimal number (723)16 is different than (723)10
• Like decimal and binary number systems, in hexadecimal number system also,
position of digits is very important
• Each position represents a specific power of base 16
• Position of first digit at the right side of the number is 0, the second digit is 1,
the third digit is 2, and so on.
• Other rules of hexadecimal number system are same as the binary number
system or octal number system
Hexadecimal Number System
Example 1
• Convert Hexadecimal number (5C7)16 into decimal number
(5C7)16 = 5  162 + C  161 + 7  160
= 5  256 + 12  16 + 7  1 ( C = 12)
= 1280 + 192 + 7 = 1479
(5C7)16 = (1479)10
Example 2
• Convert Hexadecimal number (758.D)16 into decimal number
(758.D)16 = 7  162 + 5  161 + 8  160 + D  16-1
= 7  256 + 5  16 + 8  1 + 13  1/16 ( D = 13)
= (1880.8125)10
Conversion from Decimal to
other Number System
Chapter 6 – Number System
Conversion from Decimal to other Number
System
• A decimal number may consist of two parts
• These parts are integer part and a fractional part
• Different methods are used to convert these parts into other number systems
• Conversion of Integer Part
• Progressively divide integer decimal number by the base of number system to which
you want to convert the number until the decimal number becomes zero
• Write down the remainder in reverse order to get the required number
• For example, to convert (158)10 to octal number, divide it with base 8
progressively such as:

• Hence (158)10 = (236)8


Conversion from Decimal to other Number
System
• Conversion of Decimal Fractional Part
• Following procedure is used to convert fractional part of decimal number into
another number system:
• Progressively multiply the fractional part with the base of the other number system to
which you want to convert the number
• Write down the carries in forward order to get the required number
• For example, to convert (0.625)10 into a binary number, multiply it with base 2
progressively e.g.

• Hence (0.625)10 = (.101)2


Conversion from Decimal to other Number
System
Example 1
• Convert (19.625)10 into a binary number
• Divide (19.625)10 into two parts:
• (19)10 = (?)2
• (0.625)10 = (?)2

• Combining (1) and (2) (19.625)10 = (10011.101)2


Conversion from Decimal to other Number
System
Example 2
• Convert (20154)10 into Hexadecimal number

• Hence (20154)10 = (4EBA)16


Example 3
• Convert (185.3)10 into Hexadecimal number
• Divide (185.3)10 into two parts
• (185)10 = (?)16
• (0.3)10 = (?)16

• Combining (1) and (2)


(185.3)10 = (B9.4CC)16
Octal Number to Binary
Conversion
Chapter 6 – Number System
Octal Number to Binary Conversion
• Octal number can easily be converted into a binary number and vice versa
with the help of octal - binary conversion table
• Each octal number digit represents three binary digits (i.e. 23 = 8)

Example 1
• Convert (236)8 into binary number by using a table
• From table:
• 2 = 010
• 3 = 011
• 6 = 110
• (236)8 = (010011110)2
Octal Number to Binary Conversion
Example 2
• Convert (100111001101)2 into octal number by using a table
• Make groups of 3 binary digits starting from right to left
• Add extra 0’s to the left if digits are less than three
• Groups of 3 binary digits:
100 111 001 101
• From octal – binary conversion table
• 100 = 4
• 111 = 7
• 001 = 1
• 101 = 5
• (100111001101)2 = (4715)8
Hexadecimal Number to
Binary Conversion
Chapter 6 – Number System
Hexadecimal Number to Binary Conversion
• Like Octal number system, Hexadecimal number can also be converted into a binary
number and vice versa by using a table
• Each Hexadecimal number digit represents four binary digits (i.e. 24 = 16)
Example 1
• Convert (10A8)16 into binary number by using a table
• From table:
1 = (0001)2
0 = (0000)2
A = (1010)2
8 = (1000)2
(10A8)16 = (0001 0000 1010 1000)2
Example 2
• Convert (A1.03)16 into binary number by using a table
• From table:
A = (1010)2
1 = (0001)2
0 = (0000)2
3 = (0011)2
(A1.03)16 = (1010 0001 .0000 0011)2
Binary to Hexadecimal Number Conversion
Example 3
• Convert (100111001101)2 into hexadecimal number by using a table
• Make groups of 4 binary digits starting from right to left
• Add extra 0’s to the left if digits are less than four
• Groups of 4 binary digits:
1001 1100 1101
• From Hexadecimal – Binary conversion table
1001 = 9
1100 = C
1101 = D
• Replace each group
(1001 1100 1101)2 = (9CD)16
Some important long questions
1. Why do we need so many number formats?
2. Practice conversion of number to and from these pairs including fraction values
1. Binary & Decimal
2. Octal & Decimal
3. Hexadecimal & Decimal
4. Binary & Octal
5. Binary & Hexadecimal
6. Octal & Hexadecimal

*note: Please don’t limit yourselves to these long questions only, examiner can ask
you about same material in different context.
You can extract several short questions as subset of these long questions.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy