SlideShare a Scribd company logo
1 of 8
Download to read offline
3. Convert a number from one number system to another
Conversion between number bases:
Way we need conversion?
 We need decimal system for real world (for presentation and input):
for example: we use 10-based numbering system for input and output
in digital calculator.
 We need binary system inside calculator for calculation.
Decimal
(10)
Binary (2)
Octal (8)
Hexa (16)
More Interest
Input
Conversion
10-to-2
Conversion
2-to-10
Digital
System
Output
a) Binary to decimal conversions:
 Rule: any binary number can be converted to its decimal equivalent
simply by summing together the weights of the various positions in
the binary number which contains a 1.
Example 1: Convert 110112 to its decimal equivalent
1 1 0 1 1
+ + + = 16+8+2+1= 2710
24
+23
0 21
20
Example 2: Convert 101101012 to decimal equivalent
27
+ 0+ 25
+ 24
+ 0+ 22
+ 0+ 20
= 18110
b) Decimal to binary conversions:
 There are two ways to convert a decimal number to its equivalent
binary representation
1. The reverse of the binary-to-decimal conversion process
(optional). The decimal number is simply expressed as a sum
of powers of 2 and then 12 and 02 are written in the appropriate
bit positions.
Example 1:-Convert 4510 to binary number
4510 = 32+ 8+ 4+ 1= 25
+ 0+ 23
+ 22
+ 0+ 20
=101101(2)
Example 2:-Convert 7610 to binary number
7610= 64+ 8+ 4 = 26
+ 23
+ 22
= 10011002
2. Repeated division: Repeating division the decimal number by
2 and writing down the remainder after each division until a
quotient of 0 is obtained.
Note:
The binary result is obtained by writing the first
remainder as the LSB and the last remainder as the MSB.
General Rule 1: Conversion from decimal to other base
1.Divide decimal number by the base (2, 8, 16,…).
2.The remainder is the lowest-order digit.
3.Repeat first two steps unit no divisor remains.
General Rule 2: Decimal fraction conversion to anther base
1.Multiply decimal number by the base (2, 8,…).
2.The integer is the highest-order digit.
3.Repeat first two steps until fraction becomes
zero.
Example 1 Convert 2510 to binary number
= 12 + remainder of 1 (LSB)
= 6 + remainder of 0
= 3 + remainder of 0
= 1 + remainder of 1
= 0 + remainder of 1 (MSB)
2510 = 1 1 0 0 12
Example 2 Convert 1310 to binary number
Division by 2 Quotient integer remainder
=
6 1 (a0)
3 0 (a1)
1 1 (a2)
0 1 (a3)
Answer (13)10 = (a3 a2 a1 a0) = (1101)2
Example 3: Convert 0.62510 to binary number
Multiply by 2 Integer Fraction coefficient
0.625*2 = 1 + 0.25 a1 = 1
0.250*2 = 0 + 0.50 a2 = 0
0.500*2 = 1 + 0(stop) a3 = 1
Answer (0.625)10 = (0.a1 a2 a3)2 = (0.101)2
c) Octal-to-decimal
 To convert, we need to multiply each octal digit by its positional
weight.
Example 1
372(8) = (3*82
) + (7*81
) + (2*80
) = (3*64) + 56+2 = 25010
Example 2
24.68 = (2*81
) + (4*80
) + (6*8-1
) = 20.7510
d) Decimal to octal
 Repeated division by 8.
Example 1: Convert 26610 to octal number.
= 33 + remainder of 2 (LSD)
= 4 + remainder of 1
= 0 + remainder of 4
26610 = 4 1 2(8)
Correct
order
Example 2: Convert 0.3510 to octal number.
Multiply by 8 Integer Fraction coefficient
0.35*8= 2 + 0.80 a1 = 2
0.8*8 = 6 + 0.40 a2 = 6
0.4*8 = 3 + 0.20 a3 = 3
0.2*8 = 1 + 0.60 a4 =1
0.6*8 = 4 + 0.80 a5 =4
Answer (0.35)10 = (0.a1 a2 a3 a4 a5)2 = (0.26314)8
e) Hexa-to-decimal
Example 1:-Convert 356(16) to decimal:
356(16) =
(3*162
) + (5*161
) + (6*160
) = 3*256 + 80 +6 = 854(10)
Example 2:-Convert 2AF(16) to decimal:
2AF(16) =
(2*162
) + (10*161
) + (15*160
) = 512+160+15 = 687(10)
f) Decimal-to-hexa:(using repeated division by 16)
Example 1: Convert 42310 to hex number.
= 26 + remainder of 7 (LSD)
= 1 + remainder of 10
= 0 + remainder of 1
42310 = 1 A 7(16)
Correct
order
Repeated
“stop”
g) Hexa-to-binary:
 Each hexa digit is converted to its four-bit binary equivalent:
Example 1: Convert 9F2(16) to its binary equivalent
9 F 2
1001 1111 0010
9F2(16) = 100111110010(2)
Example 2: Convert BA6(16) to binary equivalent
BA6(16) = (1011 1010 0110)2
h) Binary-to-hexa
 The binary numbers are grouped into groups of four bits and each
group is converted to its equivalent hexa digit.
 Zeros are added as needed to complete a four-bit group.
Example 1: Convert 1110100110(2) to hexa equivalent
Solution:
0011 1010 0110
3 A 6
1110100110(2) = 3A6(16)
Example 2: Convert 1010111112 to hexa equivalent
Solution:
1 0101 11112 = 15F(16)
i) Octal to binary conversion:
 Conversion each octal digit to its three bit binary equivalent.
Conversion Table
Octal digit 0 1 2 3 4 5 6 7
Binary
equivalent
000 001 010 011 100 101 110 111
Added
zeros
 Using this table, we can convert any octal number to binary by
individually converting each digit.
Example 1: Convert 472(8) to binary number
Solution:
4 7 2
100 111 010
472(8)) = 100111010(2)
Example 2: Convert 5431(8) to binary number
Solution:
5431(8) = 101 100 011 001 = 101100011001(2)
j) Binary to octal conversion:
 The bits of the binary number are grouped into group of 3 bits
starting at the LSB, then each group is converted to its octal
equivalent (see table).
Example 1: Convert 11010110(2) to octal equivalent
Solution:
011 010 110
3 2 6
11010110(2) = 326(8)
Note:
Zero was placed to the left of the MSB to produce groups
of 3 bits.
General example:
Convert 17710 to its eight-bit binary equivalent by first
converting to octal.
Added
zero
Solution:
= 22 + remainder of 1 (LSD)
= 2 + remainder of 6
= 0 + remainder of 2
17710 = 2 6 1(8)
 Thus 17710 = 261(8), now we can quickly convert this octal number
to its binary equivalent 010110001 to get eight bit representation.
So:
Important Note: this method of decimal-to-octal-to-binary
conversion is often quicker than going directly from
decimal to binary, especially for large numbers.
4. Advantage of octal and hexadecimal systems:
1. Hexa and octal number are used as a "short hand" way to represent
stings of bits.
2. Error prone to write the binary number, in hex and octal less error.
3. The octal and hexadecimal number systems are both used (in
memory addressing and microprocessor technology).

More Related Content

What's hot

What's hot (20)

Bolum1cozumler
Bolum1cozumlerBolum1cozumler
Bolum1cozumler
 
Binary number systems
Binary number systemsBinary number systems
Binary number systems
 
chapter one && two.pdf
chapter one && two.pdfchapter one && two.pdf
chapter one && two.pdf
 
Number Systems
Number SystemsNumber Systems
Number Systems
 
Number System
Number SystemNumber System
Number System
 
Binary octal
Binary octalBinary octal
Binary octal
 
ALL ABOUT NUMBER SYSTEMS
ALL ABOUT NUMBER SYSTEMSALL ABOUT NUMBER SYSTEMS
ALL ABOUT NUMBER SYSTEMS
 
PPT ON NUMBER SYSTEM
PPT ON NUMBER SYSTEMPPT ON NUMBER SYSTEM
PPT ON NUMBER SYSTEM
 
Number system and codes
Number system and codesNumber system and codes
Number system and codes
 
number system
number systemnumber system
number system
 
Conversion of number system with base concept
Conversion of number system with base conceptConversion of number system with base concept
Conversion of number system with base concept
 
digital logic design number system
digital logic design number systemdigital logic design number system
digital logic design number system
 
Basic of number system
Basic of number systemBasic of number system
Basic of number system
 
Introduction to digital electornics
Introduction to digital electornicsIntroduction to digital electornics
Introduction to digital electornics
 
Number system
Number systemNumber system
Number system
 
2.1 data represent on cpu
2.1 data represent on cpu2.1 data represent on cpu
2.1 data represent on cpu
 
Number system....
Number system....Number system....
Number system....
 
Number system
Number systemNumber system
Number system
 
Number system
Number system Number system
Number system
 
Numbersystemcont
NumbersystemcontNumbersystemcont
Numbersystemcont
 

Similar to Ncp computer appls num sys2 pramod

chapter1digitalsystemsandbinarynumbers-151021072016-lva1-app6891.pptx
chapter1digitalsystemsandbinarynumbers-151021072016-lva1-app6891.pptxchapter1digitalsystemsandbinarynumbers-151021072016-lva1-app6891.pptx
chapter1digitalsystemsandbinarynumbers-151021072016-lva1-app6891.pptxSurendra Loya
 
Chapter two FHI.pptx
Chapter two FHI.pptxChapter two FHI.pptx
Chapter two FHI.pptxODAATUBE1
 
Video lectures
Video lecturesVideo lectures
Video lecturesEdhole.com
 
Number system by ammar nawab
Number system by ammar nawabNumber system by ammar nawab
Number system by ammar nawabAmmar_n
 
Chapter 2 Data Representation on CPU (part 1)
Chapter 2 Data Representation on CPU (part 1)Chapter 2 Data Representation on CPU (part 1)
Chapter 2 Data Representation on CPU (part 1)Frankie Jones
 
Module 1 number systems and code1
Module 1  number systems and code1Module 1  number systems and code1
Module 1 number systems and code1Deepak John
 
digital-electronics.pptx
digital-electronics.pptxdigital-electronics.pptx
digital-electronics.pptxsulekhasaxena2
 
Introduction to Information Technology Lecture 2
Introduction to Information Technology Lecture 2Introduction to Information Technology Lecture 2
Introduction to Information Technology Lecture 2MikeCrea
 
Logic Design 2009
Logic Design 2009Logic Design 2009
Logic Design 2009lionking
 
W2 Chapter 2A Notes CCB1223 Digital Logic.pdf
W2 Chapter 2A Notes CCB1223 Digital Logic.pdfW2 Chapter 2A Notes CCB1223 Digital Logic.pdf
W2 Chapter 2A Notes CCB1223 Digital Logic.pdfMOHDZAMRIBINIBRAHIM1
 

Similar to Ncp computer appls num sys2 pramod (20)

chapter1digitalsystemsandbinarynumbers-151021072016-lva1-app6891.pptx
chapter1digitalsystemsandbinarynumbers-151021072016-lva1-app6891.pptxchapter1digitalsystemsandbinarynumbers-151021072016-lva1-app6891.pptx
chapter1digitalsystemsandbinarynumbers-151021072016-lva1-app6891.pptx
 
Chapter two FHI.pptx
Chapter two FHI.pptxChapter two FHI.pptx
Chapter two FHI.pptx
 
Chapter 3.pptx
Chapter 3.pptxChapter 3.pptx
Chapter 3.pptx
 
Okkkkk
OkkkkkOkkkkk
Okkkkk
 
Video lectures
Video lecturesVideo lectures
Video lectures
 
Mba ebooks
Mba ebooksMba ebooks
Mba ebooks
 
Number system by ammar nawab
Number system by ammar nawabNumber system by ammar nawab
Number system by ammar nawab
 
Chapter 2 Data Representation on CPU (part 1)
Chapter 2 Data Representation on CPU (part 1)Chapter 2 Data Representation on CPU (part 1)
Chapter 2 Data Representation on CPU (part 1)
 
Module 1 number systems and code1
Module 1  number systems and code1Module 1  number systems and code1
Module 1 number systems and code1
 
Module 4
Module 4Module 4
Module 4
 
DLD-Introduction.pptx
DLD-Introduction.pptxDLD-Introduction.pptx
DLD-Introduction.pptx
 
digital-electronics.pptx
digital-electronics.pptxdigital-electronics.pptx
digital-electronics.pptx
 
Number_Systems (2).ppt
Number_Systems (2).pptNumber_Systems (2).ppt
Number_Systems (2).ppt
 
Introduction to Information Technology Lecture 2
Introduction to Information Technology Lecture 2Introduction to Information Technology Lecture 2
Introduction to Information Technology Lecture 2
 
Number system
Number systemNumber system
Number system
 
Logic Design 2009
Logic Design 2009Logic Design 2009
Logic Design 2009
 
W2 Chapter 2A Notes CCB1223 Digital Logic.pdf
W2 Chapter 2A Notes CCB1223 Digital Logic.pdfW2 Chapter 2A Notes CCB1223 Digital Logic.pdf
W2 Chapter 2A Notes CCB1223 Digital Logic.pdf
 
Chapter 1
Chapter   1Chapter   1
Chapter 1
 
NUMBER BASE SYSTEM.pptx
NUMBER BASE SYSTEM.pptxNUMBER BASE SYSTEM.pptx
NUMBER BASE SYSTEM.pptx
 
DCF QNA edited
DCF QNA editedDCF QNA edited
DCF QNA edited
 

Recently uploaded

AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........LeaCamillePacle
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationAadityaSharma884161
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 

Recently uploaded (20)

AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint Presentation
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 

Ncp computer appls num sys2 pramod

  • 1. 3. Convert a number from one number system to another Conversion between number bases: Way we need conversion?  We need decimal system for real world (for presentation and input): for example: we use 10-based numbering system for input and output in digital calculator.  We need binary system inside calculator for calculation. Decimal (10) Binary (2) Octal (8) Hexa (16) More Interest Input Conversion 10-to-2 Conversion 2-to-10 Digital System Output
  • 2. a) Binary to decimal conversions:  Rule: any binary number can be converted to its decimal equivalent simply by summing together the weights of the various positions in the binary number which contains a 1. Example 1: Convert 110112 to its decimal equivalent 1 1 0 1 1 + + + = 16+8+2+1= 2710 24 +23 0 21 20 Example 2: Convert 101101012 to decimal equivalent 27 + 0+ 25 + 24 + 0+ 22 + 0+ 20 = 18110 b) Decimal to binary conversions:  There are two ways to convert a decimal number to its equivalent binary representation 1. The reverse of the binary-to-decimal conversion process (optional). The decimal number is simply expressed as a sum of powers of 2 and then 12 and 02 are written in the appropriate bit positions. Example 1:-Convert 4510 to binary number 4510 = 32+ 8+ 4+ 1= 25 + 0+ 23 + 22 + 0+ 20 =101101(2) Example 2:-Convert 7610 to binary number 7610= 64+ 8+ 4 = 26 + 23 + 22 = 10011002 2. Repeated division: Repeating division the decimal number by 2 and writing down the remainder after each division until a quotient of 0 is obtained. Note: The binary result is obtained by writing the first remainder as the LSB and the last remainder as the MSB. General Rule 1: Conversion from decimal to other base 1.Divide decimal number by the base (2, 8, 16,…). 2.The remainder is the lowest-order digit. 3.Repeat first two steps unit no divisor remains.
  • 3. General Rule 2: Decimal fraction conversion to anther base 1.Multiply decimal number by the base (2, 8,…). 2.The integer is the highest-order digit. 3.Repeat first two steps until fraction becomes zero. Example 1 Convert 2510 to binary number = 12 + remainder of 1 (LSB) = 6 + remainder of 0 = 3 + remainder of 0 = 1 + remainder of 1 = 0 + remainder of 1 (MSB) 2510 = 1 1 0 0 12 Example 2 Convert 1310 to binary number Division by 2 Quotient integer remainder = 6 1 (a0) 3 0 (a1) 1 1 (a2) 0 1 (a3) Answer (13)10 = (a3 a2 a1 a0) = (1101)2
  • 4. Example 3: Convert 0.62510 to binary number Multiply by 2 Integer Fraction coefficient 0.625*2 = 1 + 0.25 a1 = 1 0.250*2 = 0 + 0.50 a2 = 0 0.500*2 = 1 + 0(stop) a3 = 1 Answer (0.625)10 = (0.a1 a2 a3)2 = (0.101)2 c) Octal-to-decimal  To convert, we need to multiply each octal digit by its positional weight. Example 1 372(8) = (3*82 ) + (7*81 ) + (2*80 ) = (3*64) + 56+2 = 25010 Example 2 24.68 = (2*81 ) + (4*80 ) + (6*8-1 ) = 20.7510 d) Decimal to octal  Repeated division by 8. Example 1: Convert 26610 to octal number. = 33 + remainder of 2 (LSD) = 4 + remainder of 1 = 0 + remainder of 4 26610 = 4 1 2(8) Correct order
  • 5. Example 2: Convert 0.3510 to octal number. Multiply by 8 Integer Fraction coefficient 0.35*8= 2 + 0.80 a1 = 2 0.8*8 = 6 + 0.40 a2 = 6 0.4*8 = 3 + 0.20 a3 = 3 0.2*8 = 1 + 0.60 a4 =1 0.6*8 = 4 + 0.80 a5 =4 Answer (0.35)10 = (0.a1 a2 a3 a4 a5)2 = (0.26314)8 e) Hexa-to-decimal Example 1:-Convert 356(16) to decimal: 356(16) = (3*162 ) + (5*161 ) + (6*160 ) = 3*256 + 80 +6 = 854(10) Example 2:-Convert 2AF(16) to decimal: 2AF(16) = (2*162 ) + (10*161 ) + (15*160 ) = 512+160+15 = 687(10) f) Decimal-to-hexa:(using repeated division by 16) Example 1: Convert 42310 to hex number. = 26 + remainder of 7 (LSD) = 1 + remainder of 10 = 0 + remainder of 1 42310 = 1 A 7(16) Correct order Repeated “stop”
  • 6. g) Hexa-to-binary:  Each hexa digit is converted to its four-bit binary equivalent: Example 1: Convert 9F2(16) to its binary equivalent 9 F 2 1001 1111 0010 9F2(16) = 100111110010(2) Example 2: Convert BA6(16) to binary equivalent BA6(16) = (1011 1010 0110)2 h) Binary-to-hexa  The binary numbers are grouped into groups of four bits and each group is converted to its equivalent hexa digit.  Zeros are added as needed to complete a four-bit group. Example 1: Convert 1110100110(2) to hexa equivalent Solution: 0011 1010 0110 3 A 6 1110100110(2) = 3A6(16) Example 2: Convert 1010111112 to hexa equivalent Solution: 1 0101 11112 = 15F(16) i) Octal to binary conversion:  Conversion each octal digit to its three bit binary equivalent. Conversion Table Octal digit 0 1 2 3 4 5 6 7 Binary equivalent 000 001 010 011 100 101 110 111 Added zeros
  • 7.  Using this table, we can convert any octal number to binary by individually converting each digit. Example 1: Convert 472(8) to binary number Solution: 4 7 2 100 111 010 472(8)) = 100111010(2) Example 2: Convert 5431(8) to binary number Solution: 5431(8) = 101 100 011 001 = 101100011001(2) j) Binary to octal conversion:  The bits of the binary number are grouped into group of 3 bits starting at the LSB, then each group is converted to its octal equivalent (see table). Example 1: Convert 11010110(2) to octal equivalent Solution: 011 010 110 3 2 6 11010110(2) = 326(8) Note: Zero was placed to the left of the MSB to produce groups of 3 bits. General example: Convert 17710 to its eight-bit binary equivalent by first converting to octal. Added zero
  • 8. Solution: = 22 + remainder of 1 (LSD) = 2 + remainder of 6 = 0 + remainder of 2 17710 = 2 6 1(8)  Thus 17710 = 261(8), now we can quickly convert this octal number to its binary equivalent 010110001 to get eight bit representation. So: Important Note: this method of decimal-to-octal-to-binary conversion is often quicker than going directly from decimal to binary, especially for large numbers. 4. Advantage of octal and hexadecimal systems: 1. Hexa and octal number are used as a "short hand" way to represent stings of bits. 2. Error prone to write the binary number, in hex and octal less error. 3. The octal and hexadecimal number systems are both used (in memory addressing and microprocessor technology).