SlideShare a Scribd company logo
1 of 49
NUMBER SYSTEMS
By: Prof. Ganesh Ingle
Module 1 objective
Introduction
Number Systems
Types of Number systems
Inter conversion of number systems
Binary addition ,subtraction, multiplication and
division
Complements of binary number(1’s and 2’s
complement)
Grey code, ASCII, Ex-3,BCD
Radix of a number systems
Binary
Decimal
Hexadecimal
Octal
BCD , EBCD, Excess 3
Number system and representation
 Roman number system
1 5 10 50 100 500 1000
I V X L C D M
1 2 3 4 5 6 7 8 9
I II III IV V VI VII VIII IX
 Example 2012 to be represented in roman
 MMXII
10 20 30 40 50 60 70 80 90
X XX XXX XL L LX LXX LXXX XC
 Solve 3023
 MMMXXIII
Radix of number system
 Binary (radix=2): 1000111101 (radix=2)
 Ternary (radix=3) : 0 to 3
 Octal (radix=8): 0 to 7
 Decimal (radix=10): 0 to 9
 Hexadecimal (radix=16) : 0 to 9 and A,B,C,D,E,F
 BCD, EBCD, Excess3,BCO(coded octal),BCH(hexa)
 Binary ,octal , decimal and hexadecimal are called positional number
system
 Computers store and process data in terms of binary numbers.
 Binary numbers consist of only the digits 1 and 0.
 It is important for Computer Scientists and Computer Engineers to
understand how binary numbers work.
6Note: “Binary Numbers” are also referred to as “Base 2” numbers.
Binary Numbers
You probably learned about placeholders in the 2nd or 3rd grade. For
example:
7
3125
1’s place10’s place100’s place1000’s place
So this number represents
• 3 thousands
• 1 hundred
• 2 tens
• 5 ones
Mathematically, this is
(3 x 1000) + (1 x 100) + (2 x 10) + (5 x 1)
= 3000 + 100 + 20 + 5 = 3125
But why are the placeholders 1, 10, 100, 1000, and so on?
Review of Placeholders
 The numbers commonly used by most people are in Base
10.
 The Base of a number determines the values of its
placeholders.
8
312510
100 place101 place102 place103 place
To avoid ambiguity, we often write the base of a number as a subscript.
More on Placeholders
9
20 place21 place22 place23 place
10102
This subscript denotes that this number is in Base 2 or “Binary”.
1’s place2’s place4’s place8’s place
Binary Numbers - Example
10
10102
1’s place2’s place4’s place8’s place
So this number represents
• 1 eight
• 0 fours
• 1 two
• 0 ones
Mathematically, this is
(1 x 8) + (0 x 4) + (1 x 2) + (0 x 1)
= 8 + 0 + 2 + 0 = 1010
Binary Numbers - Example
11
Base 10
0
1
2
3
4
5
6
7
8
9
10
Base 2
0
1
10
10digits
2digits
Base 16
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
10
16digits
Note: Base 16 is also called “Hexadecimal” or “Hex”.
Base 16
Cheat Sheet
A16 = 1010
B16 = 1110
C16 = 1210
D16 = 1310
E16 = 1410
F16 = 1510
Add Placeholder
Add Placeholder
Add Placeholder
Which Digits Are Available in which Bases
12
160 place161 place162 place
3AB16
This subscript denotes that this number is in Base 16 or “Hexadecimal” or “Hex”.
1’s place16’s place256’s place
Note:
162 = 256
Hexadecimal Numbers - Example
13
3AB16
1’s place16’s place256’s place
So this number represents
• 3 two-hundred fifty-sixes
• 10 sixteens
• 11 ones
Base 16
Cheat Sheet
A16 = 1010
B16 = 1110
C16 = 1210
D16 = 1310
E16 = 1410
F16 = 1510
Mathematically, this is
(3 x 256) + (10 x 16) + (11 x 1)
= 768 + 160 + 11 = 93910
Hexadecimal Numbers - Example
14
What is the largest
number you can
represent using four
binary digits?
_ _ _ _2
1 1 1 1
23 22 21 20
8 4 2 1
=
=
=
=
8 + 4 + 2 + 1 = 1510
… the smallest
number?
_ _ _ _2
0 0 0 0
23 22 21 20
0 + 0 + 0 + 0 = 010
What is the largest
number you can
represent using a
single hexadecimal
digit?
Base 16
Cheat Sheet
A16 = 1010
B16 = 1110
C16 = 1210
D16 = 1310
E16 = 1410
F16 = 1510
_16
F = 1510
… the smallest
number?
_16
0 = 010 Note: You can represent the
same range of values with a
single hexadecimal digit that
you can represent using four
binary digits!
Why Hexadecimal Is Important
15
It can take a lot of
digits to represent
numbers in binary.
Example:
5179410 = 11001010010100102
Long strings of digits
can be difficult to
work with or look at.
Also, being only 1’s
and 0’s, it becomes
easy to insert or
delete a digit when
copying by hand.
Hexadecimal
numbers can be
used to abbreviate
binary numbers.
Starting at the least
significant digit, split
your binary number
into groups of four
digits.
Convert each group
of four binary digits
to a single hex digit.
Why Hexadecimal Is Important Continued
16
Recall the example binary number from the previous slide:
11001010010100102
1100 1010 0101 00102
First, split the
binary number
into groups of
four digits,
starting with the
least significant
digit.
Next, convert
each group of
four binary digits
to a single hex
digit.
C A 5 2
Base 16
Cheat Sheet
A16 = 1010
B16 = 1110
C16 = 1210
D16 = 1310
E16 = 1410
F16 = 1510
Put the single
hex digits
together in the
order in which
they were found,
and you’re done!
16
Converting Binary Numbers to Hex
17
In many situations, instead of using a subscript
to denote that a number is in hexadecimal, a
“0x” is appended to the front of the number.
Look! Hexadecimal Numbers!
Windows
“Blue Screen of Death”
1
8
Example:
We want to convert 12510 to hex.
125 / 16 = 7 R 13
7 / 16 = 0 R 7
12510 = 7D16
Base 16
Cheat Sheet
A16 = 1010
B16 = 1110
C16 = 1210
D16 = 1310
E16 = 1410
F16 = 1510
Converting Decimal to Hex
Decimal to binary
 3710 for integer
q r
2 37 1
2 18 0
2 9 1
2 4 0
2 2 0
2 1 1
2 0
100101
Decimal to binary
 41.68755 radix 10 for fractional number
101001
q r
2 41 1
2 20 0
2 10 0
2 5 1
2 2 0
2 1 1
2 0
0.68755 x2=1.3750
0.3750x2=0.7500
0.7500x2=1.5000
0.5000x2=1.0000
1011
41.68755=101001.1011
Note : conversion from integer to any base –r system similar
to the above example only 2 will replaced by r
Decimal to binary
 41.68755 radix 10 for fractional number Example
101001
q r
2 41 1
2 20 0
2 10 0
2 5 1
2 2 0
2 1 1
2 0
0.68755 x2=1.3750
0.3750x2=0.7500
0.7500x2=1.5000
0.5000x2=1.0000
1011
41.68755=101001.1011
Decimal to Octal
 153.153 radix 10 for fractional number to octal
231
0.153 x8=4.104
0.104x8=0.832
0.832x8=6.656
0.656x8=5.248
0.248x8=1.984
0.984x8=7.872
0.406517
153.153=231.406517
q r
8 19 1
8 2 3
8 0 2
Decimal to Octal
 153.153 radix 10 for fractional number to octal example
231
0.153 x8=4.104
0.104x8=0.832
0.832x8=6.656
0.656x8=5.248
0.248x8=1.984
0.984x8=7.872
0.406517
153.153=231.406517
q r
8 19 1
8 2 3
8 0 2
Decimal to Hexadecimal
 253 radix 10 for fractional number to Hexadecimal example
FD 253=FD
q r
16 253 13(D)
16 15 15(F)
Binary to decimal
101101 to decimal
(101101)2 =25 x 1+24 x0 +23 x1 +22 x 1 +21 x 1+20 x 1
(1011014)2 = 32+8+4+1=4510
B
 The computer systems accept the data in decimal form,
whereas they store and process the data in binary form.
Therefore, it becomes necessary to convert the numbers
represented in one system into the numbers represented in
another system. The different types of number system
conversions can be divided into the following major
categories:
• Non-decimal to decimal
• Decimal to non-decimal
• Octal to hexadecimal
Conversion of Numbers
 The non-decimal to decimal conversions can be
implemented by taking the concept of place values into
consideration. The non-decimal to decimal conversion
includes the following number system conversions:
• Binary to decimal conversion
• Hexadecimal to decimal conversion
• Octal to decimal conversion
Non-Decimal to Decimal
 A binary number can be converted to equivalent decimal
number by calculating the sum of the products of each
bit multiplied by its corresponding place value.
 Examples 6.14 and 6.17, p110.
 6.14: Convert the binary number 10101101 into its
corresponding decimal number.
(127)+(026)+(125)+(024)+(123)+(122)+ (021)+(120)
=128+0+32+0+8+4+0+1
=173
Non-Decimal to Decimal
 A hexadecimal number can be converted into its
equivalent number in decimal system by calculating the
sum of the products of each symbol multiplied by its
corresponding place value.
 Examples 6.20 and 6.22, p111.
 6.20: Convert the hexadecimal number 6B39 into its
equivalent in the decimal system.
(6163)+(11162)+(3161)+(9160)
=24567+2816+48+9
=27449
Hexadecimal to Decimal Conversion
 An octal number can be converted into its
equivalent number in decimal system by
calculating the sum of the products of each digit
multiplied by its corresponding place value.
 Examples 6.25 and 6.28, p113.
 6.25: Convert the octal number 13256 into its
equivalent in decimal systems.
(184)+(383)+(282)+(581)+(680)
=4096+1536+128+40+6
=5806
Octal to Decimal Conversion
 The decimal to non-decimal conversions are carried out
by continually dividing the decimal number by the base
of the desired number system till the decimal number
becomes zero. After the decimal number becomes zero,
we may note down the remainders calculated at each
successive division from last to first to obtain the
decimal number into the desired system. The decimal to
non-decimal conversion includes the following number
system conversions:
• Decimal to binary conversion
• Decimal to hexadecimal conversion
• Decimal to octal conversion
Decimal to Non-Decimal
 The decimal to binary conversion is
performed by repeatedly dividing
the decimal number by 2 till the
decimal number becomes zero and
then reading the remainders from
last to first to obtain the binary
equivalent to of the given decimal
number.
 Examples 6.29 and 6.30, p114.
 6.29: Convert the decimal number
30 into its equivalent binary number.
Decimal
Number
Divisor Quotient Remainder
30 2 15 0
15 2 7 1
7 2 3 1
3 2 1 1
1 2 0 1
Now, read the remainders
calculated in the above table in
upward direction to obtain the
binary equivalent, which is 11110.
Therefore, the binary equivalent of
the decimal number 30 is 11110.
Decimal to Binary Conversion
 The decimal to hexadecimal conversion is performed by repeatedly dividing
the decimal number by 16 till the decimal number becomes zero and then
reading the remainders form last to first to obtain the binary equivalent to of
the given decimal number.
Decimal
Number
Divisor Quotient Remainder
1567 16 97 15(F)
97 16 6 1
6 16 0 6
Now, read the remainders calculated in the above table in upward
direction to obtain the hexadecimal equivalent, which is 61F. Therefore,
the hexadecimal equivalent of the decimal number 1567 is 61F.
Decimal to Hexa Conversion
Examples 6.34, p116: Convert the
decimal number 1567 into its
equivalent hexadecimal number.
 The decimal to octal conversion is performed by repeatedly dividing the
decimal number by 8 till the decimal number becomes zero and then reading
the remainders form last to first to obtain the binary equivalent to of the given
decimal number.
Decimal
Number
Divisor Quotient Remainder
45796 8 5724 4
5724 8 715 4
715 8 89 3
89 8 11 1
11 8 1 3
1 8 0 1
Now, read the remainders calculated in the above table in upward
direction to obtain the octal equivalent, which is 131344. Therefore, the
octal equivalent of the decimal number 45796 is 131344.
Decimal to Octal Conversion
Examples
p117: Convert the decimal number
45796 to its equivalent octal number.
 The given octal number can be converted into its
equivalent hexadecimal number in two different steps:
• (1) Convert the given octal number into its binary
equivalent by representing each digit in the octal
number to its equivalent 3-bit binary number.
• (2) Divide the binary number into 4-bit sections starting
from the least significant bit.
Octal to Hexadecimal
• Example 6.38, p119: Convert the octal number 365
into its equivalent hexadecimal number.
3
011
6
110
5
101
0000 1111 0101
0 F 5
Therefore, the equivalent hexadecimal number is F5.
Octal to Hexadecimal
1! and 2 ! Complement
Fixed point representation and floating
point representation
+ve numbers are stored in register of digital
computer in sign magnitude form
Negative numbers are stored in three
different way
a. Signed magnitude representation
b. Signed 1s complement representation
c. Signed 2s complement representation
1! and 2 ! Complement
 Why do we require 1! and 2 ! Complement
 One’s complement and two’s complement
are two important binary concepts. Two’s
complement is especially important because
it allows us to represent signed numbers in
binary, and one’s complement is the interim
step to finding the two’s complement.
 Two’s complement also provides an easier
way to subtract numbers
1! and 2 ! Complement
Example
9 radix 10 to binary is 0 0001001
Note : here MSB 0 indicate + sign
-9 radix 10 to binary is
a. 1 0001001 signed magnitude
b. 1 1110110 signed 1s complement
c. 1 1110111 signed 2s complement
Note : 2s complement can be formed by leaving
LSB unchanged and remaining taking 1s
complement
 The BCD system is employed by computer systems to
encode the decimal number into its equivalent binary
number.
 This is generally accomplished by encoding each digit of
the decimal number into its equivalent binary sequence.
 The main advantage of BCD system is that it is a fast and
efficient system to convert the decimal numbers into
binary numbers as compared to the pure binary system.
4-Bit Binary Coded Decimal (BCD) Systems
 The 4-bit BCD system is usually employed by the
computer systems to represent and process numerical
data only. In the 4-bit BCD system, each digit of the
decimal number is encoded to its corresponding 4-bit
binary sequence. The two most popular 4-bit BCD
systems are:
• Weighted 4-bit BCD code
• Excess-3 (XS-3) BCD code
4-Bit Binary Coded Decimal (BCD) Systems
 The weighted 4-bit BCD code is more commonly known
as 8421 weighted code.
 It is called weighted code because it encodes the
decimal system into binary system by using the concept
of positional weighting into consideration.
 In this code, each decimal digit is encoded into its 4-bit
binary number in which the bits from left to right have
the weights 8, 4, 2, and 1, respectively.
Weighted 4-Bit BCD Code
 Apart from 8421, some other weighted BCD codes are
4221, 2421 and 5211.
Decimal digits Weighted 4-bit BCD code
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
Weighted 4-Bit BCD Code
 The Excess-3 (XS-3) BCD code
does not use the principle of
positional weights into
consideration while converting
the decimal numbers to 4-bit
BCD system. Therefore, we can
say that this code is a non-
weighted BCD code.
 The function of XS-3 code is to
transform the decimal numbers
into their corresponding 4-bit
BCD code.
 In this code, the decimal
number is transformed to the 4-
bit BCD code by first adding 3 to
all the digits of the number and
then converting the excess
digits, so obtained, into their
corresponding 8421 BCD code.
Therefore, we can say that the
XS-3 code is strongly related
with 8421 BCD code in its
functioning.
Excess-3 BCD Code
Decimal
digits
Excess-3 BCD code
0 0011
1 0100
2 0101
3 0110
4 0111
5 1000
6 1001
7 1010
8 1011
9 1100
 Examples
 Convert the decimal number 85 to XS-3 BCD code.
Add 3 to each digit of the given decimal number as:
8+3=11
5+3=8
The corresponding 4-bit 8421 BCD representation of the decimal digit 11 is
1011.
The corresponding 4-bit 8421 BCD representation of the decimal digit 8 is
1000.
Therefore, the XS-3 BCD representation of the decimal number 85 is 1011
1000.
Note:4-bit BCD systems are inadequate for representing and handling non-numeric data.
For this purpose, 6-bit BCD and 8-BCD systems have been developed.
Excess-3 BCD Code
 The EBCDIC code is an 8-bit alphanumeric code that was
developed by IBM to represent alphabets, decimal digits
and special characters, including control characters.
 The EBCDIC codes are generally the decimal and the
hexadecimal representation of different characters.
 This code is rarely used by non IBM-compatible computer
systems.
EBCDIC Code
 The ASCII code is pronounced as ASKEE and is used for the
same purpose for which the EBCDIC code is used. However,
this code is more popular than EBCDIC code as unlike the
EBCDIC code this code can be implemented by most of the
non-IBM computer systems.
 Initially, this code was developed as a 7-bit BCD code to
handle 128 characters but later it was modified to an 8-bit
code.
ASCII Code
 Gray code is another
important code that is also
used to convert the decimal
number into 8-bit binary
sequence. However, this
conversion is carried in a
manner that the contiguous
digits of the decimal
number differ from each
other by one bit only.
Gray Code
Decimal
Number
8-Bit Gray
Code
0 00000000
1 00000001
2 00000011
3 00000010
4 00000110
5 00000111
6 00001111
7 00001011
8 00001001
9 00001101
THANK YOU
Image Source
searchenterpriseai.techtarget.com
wikipedia

More Related Content

What's hot

Introduction to digital electornics
Introduction to digital electornicsIntroduction to digital electornics
Introduction to digital electornicsharman kaur
 
binary number system
 binary number system binary number system
binary number systemvishal gupta
 
Number System (Binary,octal,Decimal,Hexadecimal)
Number System (Binary,octal,Decimal,Hexadecimal)Number System (Binary,octal,Decimal,Hexadecimal)
Number System (Binary,octal,Decimal,Hexadecimal)Lovely Singh
 
Digital Electronics- Number systems & codes
Digital Electronics- Number systems & codes Digital Electronics- Number systems & codes
Digital Electronics- Number systems & codes VandanaPagar1
 
BINARY NUMBER SYSTEM
BINARY NUMBER SYSTEMBINARY NUMBER SYSTEM
BINARY NUMBER SYSTEMZaheer Abbasi
 
Number system computer fundamental
 Number  system computer fundamental  Number  system computer fundamental
Number system computer fundamental Aman anand kumar
 
Number system
Number systemNumber system
Number systemSajib
 
Advantage of binary number system
Advantage of binary number systemAdvantage of binary number system
Advantage of binary number systemSooraj Maurya
 
Hexadecimal to octal conversion
Hexadecimal to octal conversionHexadecimal to octal conversion
Hexadecimal to octal conversionMukesh Tekwani
 
Decimal, Binary, Octal, And Hexadecimal number systems.
Decimal, Binary, Octal, And Hexadecimal number systems.Decimal, Binary, Octal, And Hexadecimal number systems.
Decimal, Binary, Octal, And Hexadecimal number systems.AOUN ABBAS
 
01.number systems
01.number systems01.number systems
01.number systemsrasha3
 

What's hot (20)

Number System and Boolean Algebra
Number System and Boolean AlgebraNumber System and Boolean Algebra
Number System and Boolean Algebra
 
Introduction to digital electornics
Introduction to digital electornicsIntroduction to digital electornics
Introduction to digital electornics
 
Number system of computer
Number system of computerNumber system of computer
Number system of computer
 
Number+system (1)
Number+system (1)Number+system (1)
Number+system (1)
 
Conversion of number system
Conversion of number systemConversion of number system
Conversion of number system
 
binary number system
 binary number system binary number system
binary number system
 
Number system
Number systemNumber system
Number system
 
Number System (Binary,octal,Decimal,Hexadecimal)
Number System (Binary,octal,Decimal,Hexadecimal)Number System (Binary,octal,Decimal,Hexadecimal)
Number System (Binary,octal,Decimal,Hexadecimal)
 
Digital Electronics- Number systems & codes
Digital Electronics- Number systems & codes Digital Electronics- Number systems & codes
Digital Electronics- Number systems & codes
 
BINARY NUMBER SYSTEM
BINARY NUMBER SYSTEMBINARY NUMBER SYSTEM
BINARY NUMBER SYSTEM
 
Number system computer fundamental
 Number  system computer fundamental  Number  system computer fundamental
Number system computer fundamental
 
Number system
Number systemNumber system
Number system
 
W 9 numbering system
W 9 numbering systemW 9 numbering system
W 9 numbering system
 
Binary arithmetic
Binary arithmeticBinary arithmetic
Binary arithmetic
 
Advantage of binary number system
Advantage of binary number systemAdvantage of binary number system
Advantage of binary number system
 
Hexadecimal to octal conversion
Hexadecimal to octal conversionHexadecimal to octal conversion
Hexadecimal to octal conversion
 
Decimal, Binary, Octal, And Hexadecimal number systems.
Decimal, Binary, Octal, And Hexadecimal number systems.Decimal, Binary, Octal, And Hexadecimal number systems.
Decimal, Binary, Octal, And Hexadecimal number systems.
 
Number system
Number systemNumber system
Number system
 
01.number systems
01.number systems01.number systems
01.number systems
 
Number System
Number SystemNumber System
Number System
 

Similar to Number Systems

Similar to Number Systems (20)

DATA REPRESENTATION.pptx
DATA REPRESENTATION.pptxDATA REPRESENTATION.pptx
DATA REPRESENTATION.pptx
 
Number system in Digital Electronics
Number system in Digital ElectronicsNumber system in Digital Electronics
Number system in Digital Electronics
 
uyuyuy.pdf
uyuyuy.pdfuyuyuy.pdf
uyuyuy.pdf
 
Okkkkk
OkkkkkOkkkkk
Okkkkk
 
Number system
Number systemNumber system
Number system
 
Data Representation
Data RepresentationData Representation
Data Representation
 
Data representation in computers
Data representation in computersData representation in computers
Data representation in computers
 
Module 1 number systems and code1
Module 1  number systems and code1Module 1  number systems and code1
Module 1 number systems and code1
 
Number_Systems (2).ppt
Number_Systems (2).pptNumber_Systems (2).ppt
Number_Systems (2).ppt
 
PPT_Module_1.pptx
PPT_Module_1.pptxPPT_Module_1.pptx
PPT_Module_1.pptx
 
Digital Electronics Notes.pdf
Digital Electronics Notes.pdfDigital Electronics Notes.pdf
Digital Electronics Notes.pdf
 
Number system
Number systemNumber system
Number system
 
DCF QNA edited
DCF QNA editedDCF QNA edited
DCF QNA edited
 
digital-180612132737.pdf
digital-180612132737.pdfdigital-180612132737.pdf
digital-180612132737.pdf
 
Number system
Number systemNumber system
Number system
 
Number system by ammar nawab
Number system by ammar nawabNumber system by ammar nawab
Number system by ammar nawab
 
FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...
FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...
FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...
 
Digital electronics number system notes
Digital electronics number system notesDigital electronics number system notes
Digital electronics number system notes
 
Number system
Number systemNumber system
Number system
 
Numsys
NumsysNumsys
Numsys
 

More from Infinity Tech Solutions

Database Management System-session 3-4-5
Database Management System-session 3-4-5Database Management System-session 3-4-5
Database Management System-session 3-4-5Infinity Tech Solutions
 
Main topic 3 problem solving and office automation
Main topic 3 problem solving and office automationMain topic 3 problem solving and office automation
Main topic 3 problem solving and office automationInfinity Tech Solutions
 
Computer memory, Types of programming languages
Computer memory, Types of programming languagesComputer memory, Types of programming languages
Computer memory, Types of programming languagesInfinity Tech Solutions
 
AI/ML/DL/BCT A Revolution in Maritime Sector
AI/ML/DL/BCT A Revolution in Maritime SectorAI/ML/DL/BCT A Revolution in Maritime Sector
AI/ML/DL/BCT A Revolution in Maritime SectorInfinity Tech Solutions
 
Programming with matlab session 5 looping
Programming with matlab session 5 loopingProgramming with matlab session 5 looping
Programming with matlab session 5 loopingInfinity Tech Solutions
 

More from Infinity Tech Solutions (20)

Database management system session 6
Database management system session 6Database management system session 6
Database management system session 6
 
Database management system session 5
Database management system session 5Database management system session 5
Database management system session 5
 
Database Management System-session 3-4-5
Database Management System-session 3-4-5Database Management System-session 3-4-5
Database Management System-session 3-4-5
 
Database Management System-session1-2
Database Management System-session1-2Database Management System-session1-2
Database Management System-session1-2
 
Main topic 3 problem solving and office automation
Main topic 3 problem solving and office automationMain topic 3 problem solving and office automation
Main topic 3 problem solving and office automation
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
E commerce
E commerceE commerce
E commerce
 
Bds session 13 14
Bds session 13 14Bds session 13 14
Bds session 13 14
 
Computer memory, Types of programming languages
Computer memory, Types of programming languagesComputer memory, Types of programming languages
Computer memory, Types of programming languages
 
Basic hardware familiarization
Basic hardware familiarizationBasic hardware familiarization
Basic hardware familiarization
 
User defined functions in matlab
User defined functions in  matlabUser defined functions in  matlab
User defined functions in matlab
 
Programming with matlab session 6
Programming with matlab session 6Programming with matlab session 6
Programming with matlab session 6
 
Programming with matlab session 3 notes
Programming with matlab session 3 notesProgramming with matlab session 3 notes
Programming with matlab session 3 notes
 
AI/ML/DL/BCT A Revolution in Maritime Sector
AI/ML/DL/BCT A Revolution in Maritime SectorAI/ML/DL/BCT A Revolution in Maritime Sector
AI/ML/DL/BCT A Revolution in Maritime Sector
 
Programming with matlab session 5 looping
Programming with matlab session 5 loopingProgramming with matlab session 5 looping
Programming with matlab session 5 looping
 
BIG DATA Session 7 8
BIG DATA Session 7 8BIG DATA Session 7 8
BIG DATA Session 7 8
 
BIG DATA Session 6
BIG DATA Session 6BIG DATA Session 6
BIG DATA Session 6
 
MS word
MS word MS word
MS word
 
DBMS CS 4-5
DBMS CS 4-5DBMS CS 4-5
DBMS CS 4-5
 
DBMS CS3
DBMS CS3DBMS CS3
DBMS CS3
 

Recently uploaded

High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 

Recently uploaded (20)

High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 

Number Systems

  • 2. Module 1 objective Introduction Number Systems Types of Number systems Inter conversion of number systems Binary addition ,subtraction, multiplication and division Complements of binary number(1’s and 2’s complement) Grey code, ASCII, Ex-3,BCD
  • 3. Radix of a number systems Binary Decimal Hexadecimal Octal BCD , EBCD, Excess 3
  • 4. Number system and representation  Roman number system 1 5 10 50 100 500 1000 I V X L C D M 1 2 3 4 5 6 7 8 9 I II III IV V VI VII VIII IX  Example 2012 to be represented in roman  MMXII 10 20 30 40 50 60 70 80 90 X XX XXX XL L LX LXX LXXX XC  Solve 3023  MMMXXIII
  • 5. Radix of number system  Binary (radix=2): 1000111101 (radix=2)  Ternary (radix=3) : 0 to 3  Octal (radix=8): 0 to 7  Decimal (radix=10): 0 to 9  Hexadecimal (radix=16) : 0 to 9 and A,B,C,D,E,F  BCD, EBCD, Excess3,BCO(coded octal),BCH(hexa)  Binary ,octal , decimal and hexadecimal are called positional number system
  • 6.  Computers store and process data in terms of binary numbers.  Binary numbers consist of only the digits 1 and 0.  It is important for Computer Scientists and Computer Engineers to understand how binary numbers work. 6Note: “Binary Numbers” are also referred to as “Base 2” numbers. Binary Numbers
  • 7. You probably learned about placeholders in the 2nd or 3rd grade. For example: 7 3125 1’s place10’s place100’s place1000’s place So this number represents • 3 thousands • 1 hundred • 2 tens • 5 ones Mathematically, this is (3 x 1000) + (1 x 100) + (2 x 10) + (5 x 1) = 3000 + 100 + 20 + 5 = 3125 But why are the placeholders 1, 10, 100, 1000, and so on? Review of Placeholders
  • 8.  The numbers commonly used by most people are in Base 10.  The Base of a number determines the values of its placeholders. 8 312510 100 place101 place102 place103 place To avoid ambiguity, we often write the base of a number as a subscript. More on Placeholders
  • 9. 9 20 place21 place22 place23 place 10102 This subscript denotes that this number is in Base 2 or “Binary”. 1’s place2’s place4’s place8’s place Binary Numbers - Example
  • 10. 10 10102 1’s place2’s place4’s place8’s place So this number represents • 1 eight • 0 fours • 1 two • 0 ones Mathematically, this is (1 x 8) + (0 x 4) + (1 x 2) + (0 x 1) = 8 + 0 + 2 + 0 = 1010 Binary Numbers - Example
  • 11. 11 Base 10 0 1 2 3 4 5 6 7 8 9 10 Base 2 0 1 10 10digits 2digits Base 16 0 1 2 3 4 5 6 7 8 9 A B C D E F 10 16digits Note: Base 16 is also called “Hexadecimal” or “Hex”. Base 16 Cheat Sheet A16 = 1010 B16 = 1110 C16 = 1210 D16 = 1310 E16 = 1410 F16 = 1510 Add Placeholder Add Placeholder Add Placeholder Which Digits Are Available in which Bases
  • 12. 12 160 place161 place162 place 3AB16 This subscript denotes that this number is in Base 16 or “Hexadecimal” or “Hex”. 1’s place16’s place256’s place Note: 162 = 256 Hexadecimal Numbers - Example
  • 13. 13 3AB16 1’s place16’s place256’s place So this number represents • 3 two-hundred fifty-sixes • 10 sixteens • 11 ones Base 16 Cheat Sheet A16 = 1010 B16 = 1110 C16 = 1210 D16 = 1310 E16 = 1410 F16 = 1510 Mathematically, this is (3 x 256) + (10 x 16) + (11 x 1) = 768 + 160 + 11 = 93910 Hexadecimal Numbers - Example
  • 14. 14 What is the largest number you can represent using four binary digits? _ _ _ _2 1 1 1 1 23 22 21 20 8 4 2 1 = = = = 8 + 4 + 2 + 1 = 1510 … the smallest number? _ _ _ _2 0 0 0 0 23 22 21 20 0 + 0 + 0 + 0 = 010 What is the largest number you can represent using a single hexadecimal digit? Base 16 Cheat Sheet A16 = 1010 B16 = 1110 C16 = 1210 D16 = 1310 E16 = 1410 F16 = 1510 _16 F = 1510 … the smallest number? _16 0 = 010 Note: You can represent the same range of values with a single hexadecimal digit that you can represent using four binary digits! Why Hexadecimal Is Important
  • 15. 15 It can take a lot of digits to represent numbers in binary. Example: 5179410 = 11001010010100102 Long strings of digits can be difficult to work with or look at. Also, being only 1’s and 0’s, it becomes easy to insert or delete a digit when copying by hand. Hexadecimal numbers can be used to abbreviate binary numbers. Starting at the least significant digit, split your binary number into groups of four digits. Convert each group of four binary digits to a single hex digit. Why Hexadecimal Is Important Continued
  • 16. 16 Recall the example binary number from the previous slide: 11001010010100102 1100 1010 0101 00102 First, split the binary number into groups of four digits, starting with the least significant digit. Next, convert each group of four binary digits to a single hex digit. C A 5 2 Base 16 Cheat Sheet A16 = 1010 B16 = 1110 C16 = 1210 D16 = 1310 E16 = 1410 F16 = 1510 Put the single hex digits together in the order in which they were found, and you’re done! 16 Converting Binary Numbers to Hex
  • 17. 17 In many situations, instead of using a subscript to denote that a number is in hexadecimal, a “0x” is appended to the front of the number. Look! Hexadecimal Numbers! Windows “Blue Screen of Death”
  • 18. 1 8 Example: We want to convert 12510 to hex. 125 / 16 = 7 R 13 7 / 16 = 0 R 7 12510 = 7D16 Base 16 Cheat Sheet A16 = 1010 B16 = 1110 C16 = 1210 D16 = 1310 E16 = 1410 F16 = 1510 Converting Decimal to Hex
  • 19. Decimal to binary  3710 for integer q r 2 37 1 2 18 0 2 9 1 2 4 0 2 2 0 2 1 1 2 0 100101
  • 20. Decimal to binary  41.68755 radix 10 for fractional number 101001 q r 2 41 1 2 20 0 2 10 0 2 5 1 2 2 0 2 1 1 2 0 0.68755 x2=1.3750 0.3750x2=0.7500 0.7500x2=1.5000 0.5000x2=1.0000 1011 41.68755=101001.1011 Note : conversion from integer to any base –r system similar to the above example only 2 will replaced by r
  • 21. Decimal to binary  41.68755 radix 10 for fractional number Example 101001 q r 2 41 1 2 20 0 2 10 0 2 5 1 2 2 0 2 1 1 2 0 0.68755 x2=1.3750 0.3750x2=0.7500 0.7500x2=1.5000 0.5000x2=1.0000 1011 41.68755=101001.1011
  • 22. Decimal to Octal  153.153 radix 10 for fractional number to octal 231 0.153 x8=4.104 0.104x8=0.832 0.832x8=6.656 0.656x8=5.248 0.248x8=1.984 0.984x8=7.872 0.406517 153.153=231.406517 q r 8 19 1 8 2 3 8 0 2
  • 23. Decimal to Octal  153.153 radix 10 for fractional number to octal example 231 0.153 x8=4.104 0.104x8=0.832 0.832x8=6.656 0.656x8=5.248 0.248x8=1.984 0.984x8=7.872 0.406517 153.153=231.406517 q r 8 19 1 8 2 3 8 0 2
  • 24. Decimal to Hexadecimal  253 radix 10 for fractional number to Hexadecimal example FD 253=FD q r 16 253 13(D) 16 15 15(F)
  • 25. Binary to decimal 101101 to decimal (101101)2 =25 x 1+24 x0 +23 x1 +22 x 1 +21 x 1+20 x 1 (1011014)2 = 32+8+4+1=4510 B
  • 26.  The computer systems accept the data in decimal form, whereas they store and process the data in binary form. Therefore, it becomes necessary to convert the numbers represented in one system into the numbers represented in another system. The different types of number system conversions can be divided into the following major categories: • Non-decimal to decimal • Decimal to non-decimal • Octal to hexadecimal Conversion of Numbers
  • 27.  The non-decimal to decimal conversions can be implemented by taking the concept of place values into consideration. The non-decimal to decimal conversion includes the following number system conversions: • Binary to decimal conversion • Hexadecimal to decimal conversion • Octal to decimal conversion Non-Decimal to Decimal
  • 28.  A binary number can be converted to equivalent decimal number by calculating the sum of the products of each bit multiplied by its corresponding place value.  Examples 6.14 and 6.17, p110.  6.14: Convert the binary number 10101101 into its corresponding decimal number. (127)+(026)+(125)+(024)+(123)+(122)+ (021)+(120) =128+0+32+0+8+4+0+1 =173 Non-Decimal to Decimal
  • 29.  A hexadecimal number can be converted into its equivalent number in decimal system by calculating the sum of the products of each symbol multiplied by its corresponding place value.  Examples 6.20 and 6.22, p111.  6.20: Convert the hexadecimal number 6B39 into its equivalent in the decimal system. (6163)+(11162)+(3161)+(9160) =24567+2816+48+9 =27449 Hexadecimal to Decimal Conversion
  • 30.  An octal number can be converted into its equivalent number in decimal system by calculating the sum of the products of each digit multiplied by its corresponding place value.  Examples 6.25 and 6.28, p113.  6.25: Convert the octal number 13256 into its equivalent in decimal systems. (184)+(383)+(282)+(581)+(680) =4096+1536+128+40+6 =5806 Octal to Decimal Conversion
  • 31.  The decimal to non-decimal conversions are carried out by continually dividing the decimal number by the base of the desired number system till the decimal number becomes zero. After the decimal number becomes zero, we may note down the remainders calculated at each successive division from last to first to obtain the decimal number into the desired system. The decimal to non-decimal conversion includes the following number system conversions: • Decimal to binary conversion • Decimal to hexadecimal conversion • Decimal to octal conversion Decimal to Non-Decimal
  • 32.  The decimal to binary conversion is performed by repeatedly dividing the decimal number by 2 till the decimal number becomes zero and then reading the remainders from last to first to obtain the binary equivalent to of the given decimal number.  Examples 6.29 and 6.30, p114.  6.29: Convert the decimal number 30 into its equivalent binary number. Decimal Number Divisor Quotient Remainder 30 2 15 0 15 2 7 1 7 2 3 1 3 2 1 1 1 2 0 1 Now, read the remainders calculated in the above table in upward direction to obtain the binary equivalent, which is 11110. Therefore, the binary equivalent of the decimal number 30 is 11110. Decimal to Binary Conversion
  • 33.  The decimal to hexadecimal conversion is performed by repeatedly dividing the decimal number by 16 till the decimal number becomes zero and then reading the remainders form last to first to obtain the binary equivalent to of the given decimal number. Decimal Number Divisor Quotient Remainder 1567 16 97 15(F) 97 16 6 1 6 16 0 6 Now, read the remainders calculated in the above table in upward direction to obtain the hexadecimal equivalent, which is 61F. Therefore, the hexadecimal equivalent of the decimal number 1567 is 61F. Decimal to Hexa Conversion Examples 6.34, p116: Convert the decimal number 1567 into its equivalent hexadecimal number.
  • 34.  The decimal to octal conversion is performed by repeatedly dividing the decimal number by 8 till the decimal number becomes zero and then reading the remainders form last to first to obtain the binary equivalent to of the given decimal number. Decimal Number Divisor Quotient Remainder 45796 8 5724 4 5724 8 715 4 715 8 89 3 89 8 11 1 11 8 1 3 1 8 0 1 Now, read the remainders calculated in the above table in upward direction to obtain the octal equivalent, which is 131344. Therefore, the octal equivalent of the decimal number 45796 is 131344. Decimal to Octal Conversion Examples p117: Convert the decimal number 45796 to its equivalent octal number.
  • 35.  The given octal number can be converted into its equivalent hexadecimal number in two different steps: • (1) Convert the given octal number into its binary equivalent by representing each digit in the octal number to its equivalent 3-bit binary number. • (2) Divide the binary number into 4-bit sections starting from the least significant bit. Octal to Hexadecimal
  • 36. • Example 6.38, p119: Convert the octal number 365 into its equivalent hexadecimal number. 3 011 6 110 5 101 0000 1111 0101 0 F 5 Therefore, the equivalent hexadecimal number is F5. Octal to Hexadecimal
  • 37. 1! and 2 ! Complement Fixed point representation and floating point representation +ve numbers are stored in register of digital computer in sign magnitude form Negative numbers are stored in three different way a. Signed magnitude representation b. Signed 1s complement representation c. Signed 2s complement representation
  • 38. 1! and 2 ! Complement  Why do we require 1! and 2 ! Complement  One’s complement and two’s complement are two important binary concepts. Two’s complement is especially important because it allows us to represent signed numbers in binary, and one’s complement is the interim step to finding the two’s complement.  Two’s complement also provides an easier way to subtract numbers
  • 39. 1! and 2 ! Complement Example 9 radix 10 to binary is 0 0001001 Note : here MSB 0 indicate + sign -9 radix 10 to binary is a. 1 0001001 signed magnitude b. 1 1110110 signed 1s complement c. 1 1110111 signed 2s complement Note : 2s complement can be formed by leaving LSB unchanged and remaining taking 1s complement
  • 40.  The BCD system is employed by computer systems to encode the decimal number into its equivalent binary number.  This is generally accomplished by encoding each digit of the decimal number into its equivalent binary sequence.  The main advantage of BCD system is that it is a fast and efficient system to convert the decimal numbers into binary numbers as compared to the pure binary system. 4-Bit Binary Coded Decimal (BCD) Systems
  • 41.  The 4-bit BCD system is usually employed by the computer systems to represent and process numerical data only. In the 4-bit BCD system, each digit of the decimal number is encoded to its corresponding 4-bit binary sequence. The two most popular 4-bit BCD systems are: • Weighted 4-bit BCD code • Excess-3 (XS-3) BCD code 4-Bit Binary Coded Decimal (BCD) Systems
  • 42.  The weighted 4-bit BCD code is more commonly known as 8421 weighted code.  It is called weighted code because it encodes the decimal system into binary system by using the concept of positional weighting into consideration.  In this code, each decimal digit is encoded into its 4-bit binary number in which the bits from left to right have the weights 8, 4, 2, and 1, respectively. Weighted 4-Bit BCD Code
  • 43.  Apart from 8421, some other weighted BCD codes are 4221, 2421 and 5211. Decimal digits Weighted 4-bit BCD code 0 0000 1 0001 2 0010 3 0011 4 0100 5 0101 6 0110 7 0111 8 1000 9 1001 Weighted 4-Bit BCD Code
  • 44.  The Excess-3 (XS-3) BCD code does not use the principle of positional weights into consideration while converting the decimal numbers to 4-bit BCD system. Therefore, we can say that this code is a non- weighted BCD code.  The function of XS-3 code is to transform the decimal numbers into their corresponding 4-bit BCD code.  In this code, the decimal number is transformed to the 4- bit BCD code by first adding 3 to all the digits of the number and then converting the excess digits, so obtained, into their corresponding 8421 BCD code. Therefore, we can say that the XS-3 code is strongly related with 8421 BCD code in its functioning. Excess-3 BCD Code Decimal digits Excess-3 BCD code 0 0011 1 0100 2 0101 3 0110 4 0111 5 1000 6 1001 7 1010 8 1011 9 1100
  • 45.  Examples  Convert the decimal number 85 to XS-3 BCD code. Add 3 to each digit of the given decimal number as: 8+3=11 5+3=8 The corresponding 4-bit 8421 BCD representation of the decimal digit 11 is 1011. The corresponding 4-bit 8421 BCD representation of the decimal digit 8 is 1000. Therefore, the XS-3 BCD representation of the decimal number 85 is 1011 1000. Note:4-bit BCD systems are inadequate for representing and handling non-numeric data. For this purpose, 6-bit BCD and 8-BCD systems have been developed. Excess-3 BCD Code
  • 46.  The EBCDIC code is an 8-bit alphanumeric code that was developed by IBM to represent alphabets, decimal digits and special characters, including control characters.  The EBCDIC codes are generally the decimal and the hexadecimal representation of different characters.  This code is rarely used by non IBM-compatible computer systems. EBCDIC Code
  • 47.  The ASCII code is pronounced as ASKEE and is used for the same purpose for which the EBCDIC code is used. However, this code is more popular than EBCDIC code as unlike the EBCDIC code this code can be implemented by most of the non-IBM computer systems.  Initially, this code was developed as a 7-bit BCD code to handle 128 characters but later it was modified to an 8-bit code. ASCII Code
  • 48.  Gray code is another important code that is also used to convert the decimal number into 8-bit binary sequence. However, this conversion is carried in a manner that the contiguous digits of the decimal number differ from each other by one bit only. Gray Code Decimal Number 8-Bit Gray Code 0 00000000 1 00000001 2 00000011 3 00000010 4 00000110 5 00000111 6 00001111 7 00001011 8 00001001 9 00001101