SlideShare a Scribd company logo
1 of 32
1
Computer Logic Design
Lecture 2
Number Systems
LECTURERS:DAROON ALI &SAZAN KAMAL
BAYAN UNIVERSITY
Outlines
Base of Number Systems
Decimal Numbers
Binary Numbers
 MSB and LSB
 Binary to Decimal Conversion
 Decimal To Binary Conversion
Hexadecimal Numbers
 Conversions
Octal Numbers
 Conversions
Number Systems
The numeric system we use daily is the decimal system,
 but this system is not convenient for machines
 since the information is handled codified in the shape of On or Off bits;
A base of a number system defines the range of values that a digit may have. For example,
 base 2 Binary number has only Two different values (0 and 1).
 base 10 Decimal number has Ten different values (0,1,2,3,4,5,6,7,8 and 9).
 And etc.…
Decimal Numbers
The position of each digit in a weighted number system is assigned a weight based on the base
of the system.
 The base of decimal numbers is ten, because only ten symbols (0 through 9) are used to represent any
number.
The column weights of decimal numbers are powers of ten that increase from right to left
beginning with 100 =1:
 105 104 103 102 101 100
For fractional decimal numbers, the column weights are negative powers of ten that decrease
from left to right:
 102 101 100. 10-1 10-2 10-3 10-4
Decimal Numbers
Decimal numbers can be expressed as the sum of the products of each digit times the column
value for that digit.
 Thus, the number 9240 can be expressed as
Example: Express the number 480.52 as the sum of values of each digit.
(9 x 103) + (2 x 102) + (4 x 101) + (0 x 100)
or
9 x 1,000 + 2 x 100 + 4 x 10 + 0 x 1
480.52 = (4 x 102) + (8 x 101) + (0 x 100) + (5 x 10-1) +(2 x 10-2)
Binary Numbers
For digital systems, the binary number system is used. Binary has a radix of two and uses the
digits 0 and 1 to represent quantities.
The column weights of binary numbers are powers of two that increase from right to left
beginning with 20 =1:
 …25 24 23 22 21 20.
For fractional binary numbers, the column weights are negative powers of two that decrease
from left to right:
 22 21 20. 2-1 2-2 2-3 2-4 …
LSB and MSB
Binary number can be a stream of 0 and 1
 For Example :
 10010010
 010101
 111001
 1101100
The first bit from the left is called Most Significant Bit (MSB)
 Because of its significance on the number.
The first bit from the right is called Least Significant Bit (LSB)
 Because of its low significance on the number.
1001101
MSB LSB
Second MSB
Binary-to-Decimal Conversion
The decimal equivalent of a binary number can be determined by adding the column values of
all of the bits that are 1 and discarding all of the bits that are 0.
Example: Convert the binary number 100101.01 to decimal.
Solution:
Binary-to-Decimal Conversion
Decimal-to-Binary Conversion
 You can convert a decimal whole number to binary by reversing the procedure.
 Write the decimal weight of each column and place 1’s in the columns that sum to the decimal
number This Method is called Sum - Of - Weights Method.
 Example : Convert the decimal number 49 to binary.
 Solution :
 The column weights double in each position to the right.
 Write down column weights until the last number is larger than the one you want to convert.
Decimal-to-Binary Conversion
Repeated Division-by-2 Method
A systematic method of converting whole numbers from decimal to binary is the repeated
division-by-2 process.
 For example, to convert the decimal number 12 to binary,
 begin by dividing 12 by 2.
 Then divide each resulting quotient by 2 until there is a 0 whole-number quotient.
 The remainders generated by each division form the binary number.
 The first remainder to be produced is the LSB (least significant bit) in the binary number,
 and the last remainder to be produced is the MSB (most significant bit).
 This procedure is shown in the following steps for converting the decimal number 12 to binary.
Decimal-to-Binary Conversion
Decimal-to-Binary Conversion
Example:
 Convert the following decimal
numbers to binary:
 (a) 19 (b) 45
Decimal-to-Binary Conversion
Converting Decimal Fractions to Binary
Sum-oF-Weights
 The sum-of-weights method can be applied to fractional decimal numbers, as shown in the
following example:
 0.625 = 0.5 + 0.125 = 2-1 + 2-3 = 0.101
 There is a 1 in the 2-1 position, a 0 in the 2-2 position, and a 1 in the 2-3 position.
Decimal-to-Binary Conversion
Repeated Multiplication by 2
As you have seen, decimal whole numbers can be converted to binary by
repeated division by 2.
Decimal fractions can be converted to binary by repeated multiplication by 2.
For example, to convert the decimal fraction 0.3125 to binary,
 begin by multiplying 0.3125 by 2
 and then multiplying each resulting fractional part of the product by 2 until the fractional product is
zero or until the desired number of decimal places is reached.
 The carry digits, or carries, generated by the multiplications produce the binary number.
 The first carry produced is the MSB, and the last carry is the LSB. This procedure is illustrated as
follows:
Decimal-to-Binary Conversion
Decimal-to-Binary Conversion
Example : Convert the decimal fraction 0.188 to binary by repeatedly multiplying the fractional
results by 2.
Solution:
Hexadecimal Numbers
The hexadecimal number system has sixteen characters.
They are:
 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
Hexadecimal is a weighted number system. The column weights are
powers of 16, which increase from right to left.
4096 256 16 1
163 162 161 160
Hexadecimal Numbers
Binary-to-Hexadecimal Conversion
Converting a binary number to hexadecimal is a straightforward procedure.
Simply break the binary number into 4-bit groups, starting at the right-most bit and replace each
4-bit group with the equivalent hexadecimal symbol.
Hexadecimal-to-Binary Conversion
To convert from a hexadecimal number to a binary number, reverse the process and replace
each hexadecimal symbol with the appropriate four bits.
Hexadecimal-to-Decimal Conversion
One way to find the decimal equivalent of a hexadecimal number is
 first convert the hexadecimal number to binary and then convert from binary to decimal.
Hexadecimal-to-Decimal Conversion
Another way to convert a hexadecimal number to its decimal equivalent is
 multiply the decimal value of each hexadecimal digit by its weight and then take the sum of
these products.
 The weights of a hexadecimal number are increasing powers of 16 (from right to left).
 For a 4-digit hexadecimal number, the weights are
4096 256 16 1
163 162 161 160
Hexadecimal-to-Decimal Conversion
Example : Express 1A2F16 in decimal.
Solution :
 Start by writing the column weights:
 4096 256 16 1
 ( 1 A 2 F)16
= 1(4096) + 10(256) +2(16) +15(1) = 6703
Decimal-to-Hexadecimal Conversion
Repeated division of a decimal number by 16 will produce the equivalent hexadecimal number,
formed by the remainders of the divisions.
The first remainder produced is the least significant Digit (LSD).
Each successive division by 16 yields a remainder that becomes a digit in the equivalent
hexadecimal number.
Decimal-to-Hexadecimal Conversion
Octal Numbers
Like the hexadecimal number system, the octal number system provides a convenient way to
express binary numbers and codes.
The octal number system is composed of eight digits, which are
 0, I, 2, 3, 4, 5, 6, 7
Octal-to-Decimal Conversion
Since the octal number system has a base of eight,
each successive digit position is an increasing power of eight, beginning in the right-most
column with 8°.
The evaluation of an octal number in terms of its decimal equivalent is accomplished by
multiplying each digit by its weight and summing the products,
 as illustrated here for (2374),
Decimal-to-Octal Conversion
A method of converting a decimal number to an octal number is the repeated division-by- 8
method,
Octal-to-Binary Conversion
Because each octal digit can be represented by a 3-bit binary number, it is very easy to convert
from octal to binary. Each octal digit is represented by three bits as shown below.
To convert an octal number to a binary number, simply replace each octal digit with the
appropriate three bits.
Binary-to-Octal Conversion
Conversion of a binary number to an octal number is the reverse of the
octal-to-binary conversion.
The procedure is as follows:
 Start with the right-most group of three bits and, moving from right to left,
 convert each 3-bit group to the equivalent octal digit.
 If there are not three bits available for the left-most group, add either one or two
zeroes to make a complete group.
 These leading zeroes do not affect the value of the binary number
Binary-to-Octal Conversion

More Related Content

Similar to Lecture 02 - Logic Design(Number Systems).pptx

Number system by ammar nawab
Number system by ammar nawabNumber system by ammar nawab
Number system by ammar nawabAmmar_n
 
U1 - Code Conversion.pptx
U1 - Code Conversion.pptxU1 - Code Conversion.pptx
U1 - Code Conversion.pptxRamKumar612299
 
Introduction of number system
Introduction of number systemIntroduction of number system
Introduction of number systemAswiniT3
 
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...Arti Parab Academics
 
IS 139 Lecture 4 - 2015
IS 139 Lecture 4 - 2015IS 139 Lecture 4 - 2015
IS 139 Lecture 4 - 2015Aron Kondoro
 
IS 139 Lecture 4
IS 139 Lecture 4IS 139 Lecture 4
IS 139 Lecture 4wajanga
 
Introduction to number system
Introduction to number systemIntroduction to number system
Introduction to number systemAswiniT3
 
Number Systems.ppt
Number Systems.pptNumber Systems.ppt
Number Systems.pptzorogoh2
 
Unit 1 data representation and computer arithmetic
Unit 1  data representation and computer arithmeticUnit 1  data representation and computer arithmetic
Unit 1 data representation and computer arithmeticAmrutaMehata
 
Module 1 number systems and code1
Module 1  number systems and code1Module 1  number systems and code1
Module 1 number systems and code1Deepak John
 
Data representation
Data representationData representation
Data representationManish Kumar
 
Lec 02 data representation part 1
Lec 02 data representation part 1Lec 02 data representation part 1
Lec 02 data representation part 1Abdul Khan
 
1.Digital Electronics overview & Number Systems.pptx
1.Digital Electronics overview & Number Systems.pptx1.Digital Electronics overview & Number Systems.pptx
1.Digital Electronics overview & Number Systems.pptxLibanMohamed26
 
DLD_PPT_0.pptx
DLD_PPT_0.pptxDLD_PPT_0.pptx
DLD_PPT_0.pptxECENAAC2
 

Similar to Lecture 02 - Logic Design(Number Systems).pptx (20)

Number system by ammar nawab
Number system by ammar nawabNumber system by ammar nawab
Number system by ammar nawab
 
U1 - Code Conversion.pptx
U1 - Code Conversion.pptxU1 - Code Conversion.pptx
U1 - Code Conversion.pptx
 
Introduction of number system
Introduction of number systemIntroduction of number system
Introduction of number system
 
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...
 
IS 139 Lecture 4 - 2015
IS 139 Lecture 4 - 2015IS 139 Lecture 4 - 2015
IS 139 Lecture 4 - 2015
 
IS 139 Lecture 4
IS 139 Lecture 4IS 139 Lecture 4
IS 139 Lecture 4
 
Number system
Number systemNumber system
Number system
 
Data representation in computers
Data representation in computersData representation in computers
Data representation in computers
 
Introduction to number system
Introduction to number systemIntroduction to number system
Introduction to number system
 
Number Systems.ppt
Number Systems.pptNumber Systems.ppt
Number Systems.ppt
 
005618132.pdf
005618132.pdf005618132.pdf
005618132.pdf
 
Data Representation
Data RepresentationData Representation
Data Representation
 
Unit 1 data representation and computer arithmetic
Unit 1  data representation and computer arithmeticUnit 1  data representation and computer arithmetic
Unit 1 data representation and computer arithmetic
 
Module 1 number systems and code1
Module 1  number systems and code1Module 1  number systems and code1
Module 1 number systems and code1
 
Data representation
Data representationData representation
Data representation
 
Lec 02 data representation part 1
Lec 02 data representation part 1Lec 02 data representation part 1
Lec 02 data representation part 1
 
Data Representation
Data RepresentationData Representation
Data Representation
 
Number system
Number systemNumber system
Number system
 
1.Digital Electronics overview & Number Systems.pptx
1.Digital Electronics overview & Number Systems.pptx1.Digital Electronics overview & Number Systems.pptx
1.Digital Electronics overview & Number Systems.pptx
 
DLD_PPT_0.pptx
DLD_PPT_0.pptxDLD_PPT_0.pptx
DLD_PPT_0.pptx
 

Recently uploaded

Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxnada99848
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 

Recently uploaded (20)

Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptx
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 

Lecture 02 - Logic Design(Number Systems).pptx

  • 1. 1 Computer Logic Design Lecture 2 Number Systems LECTURERS:DAROON ALI &SAZAN KAMAL BAYAN UNIVERSITY
  • 2. Outlines Base of Number Systems Decimal Numbers Binary Numbers  MSB and LSB  Binary to Decimal Conversion  Decimal To Binary Conversion Hexadecimal Numbers  Conversions Octal Numbers  Conversions
  • 3. Number Systems The numeric system we use daily is the decimal system,  but this system is not convenient for machines  since the information is handled codified in the shape of On or Off bits; A base of a number system defines the range of values that a digit may have. For example,  base 2 Binary number has only Two different values (0 and 1).  base 10 Decimal number has Ten different values (0,1,2,3,4,5,6,7,8 and 9).  And etc.…
  • 4. Decimal Numbers The position of each digit in a weighted number system is assigned a weight based on the base of the system.  The base of decimal numbers is ten, because only ten symbols (0 through 9) are used to represent any number. The column weights of decimal numbers are powers of ten that increase from right to left beginning with 100 =1:  105 104 103 102 101 100 For fractional decimal numbers, the column weights are negative powers of ten that decrease from left to right:  102 101 100. 10-1 10-2 10-3 10-4
  • 5. Decimal Numbers Decimal numbers can be expressed as the sum of the products of each digit times the column value for that digit.  Thus, the number 9240 can be expressed as Example: Express the number 480.52 as the sum of values of each digit. (9 x 103) + (2 x 102) + (4 x 101) + (0 x 100) or 9 x 1,000 + 2 x 100 + 4 x 10 + 0 x 1 480.52 = (4 x 102) + (8 x 101) + (0 x 100) + (5 x 10-1) +(2 x 10-2)
  • 6. Binary Numbers For digital systems, the binary number system is used. Binary has a radix of two and uses the digits 0 and 1 to represent quantities. The column weights of binary numbers are powers of two that increase from right to left beginning with 20 =1:  …25 24 23 22 21 20. For fractional binary numbers, the column weights are negative powers of two that decrease from left to right:  22 21 20. 2-1 2-2 2-3 2-4 …
  • 7. LSB and MSB Binary number can be a stream of 0 and 1  For Example :  10010010  010101  111001  1101100 The first bit from the left is called Most Significant Bit (MSB)  Because of its significance on the number. The first bit from the right is called Least Significant Bit (LSB)  Because of its low significance on the number. 1001101 MSB LSB Second MSB
  • 8. Binary-to-Decimal Conversion The decimal equivalent of a binary number can be determined by adding the column values of all of the bits that are 1 and discarding all of the bits that are 0. Example: Convert the binary number 100101.01 to decimal. Solution:
  • 10. Decimal-to-Binary Conversion  You can convert a decimal whole number to binary by reversing the procedure.  Write the decimal weight of each column and place 1’s in the columns that sum to the decimal number This Method is called Sum - Of - Weights Method.  Example : Convert the decimal number 49 to binary.  Solution :  The column weights double in each position to the right.  Write down column weights until the last number is larger than the one you want to convert.
  • 11. Decimal-to-Binary Conversion Repeated Division-by-2 Method A systematic method of converting whole numbers from decimal to binary is the repeated division-by-2 process.  For example, to convert the decimal number 12 to binary,  begin by dividing 12 by 2.  Then divide each resulting quotient by 2 until there is a 0 whole-number quotient.  The remainders generated by each division form the binary number.  The first remainder to be produced is the LSB (least significant bit) in the binary number,  and the last remainder to be produced is the MSB (most significant bit).  This procedure is shown in the following steps for converting the decimal number 12 to binary.
  • 13. Decimal-to-Binary Conversion Example:  Convert the following decimal numbers to binary:  (a) 19 (b) 45
  • 14. Decimal-to-Binary Conversion Converting Decimal Fractions to Binary Sum-oF-Weights  The sum-of-weights method can be applied to fractional decimal numbers, as shown in the following example:  0.625 = 0.5 + 0.125 = 2-1 + 2-3 = 0.101  There is a 1 in the 2-1 position, a 0 in the 2-2 position, and a 1 in the 2-3 position.
  • 15. Decimal-to-Binary Conversion Repeated Multiplication by 2 As you have seen, decimal whole numbers can be converted to binary by repeated division by 2. Decimal fractions can be converted to binary by repeated multiplication by 2. For example, to convert the decimal fraction 0.3125 to binary,  begin by multiplying 0.3125 by 2  and then multiplying each resulting fractional part of the product by 2 until the fractional product is zero or until the desired number of decimal places is reached.  The carry digits, or carries, generated by the multiplications produce the binary number.  The first carry produced is the MSB, and the last carry is the LSB. This procedure is illustrated as follows:
  • 17. Decimal-to-Binary Conversion Example : Convert the decimal fraction 0.188 to binary by repeatedly multiplying the fractional results by 2. Solution:
  • 18. Hexadecimal Numbers The hexadecimal number system has sixteen characters. They are:  0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F Hexadecimal is a weighted number system. The column weights are powers of 16, which increase from right to left. 4096 256 16 1 163 162 161 160
  • 20. Binary-to-Hexadecimal Conversion Converting a binary number to hexadecimal is a straightforward procedure. Simply break the binary number into 4-bit groups, starting at the right-most bit and replace each 4-bit group with the equivalent hexadecimal symbol.
  • 21. Hexadecimal-to-Binary Conversion To convert from a hexadecimal number to a binary number, reverse the process and replace each hexadecimal symbol with the appropriate four bits.
  • 22. Hexadecimal-to-Decimal Conversion One way to find the decimal equivalent of a hexadecimal number is  first convert the hexadecimal number to binary and then convert from binary to decimal.
  • 23. Hexadecimal-to-Decimal Conversion Another way to convert a hexadecimal number to its decimal equivalent is  multiply the decimal value of each hexadecimal digit by its weight and then take the sum of these products.  The weights of a hexadecimal number are increasing powers of 16 (from right to left).  For a 4-digit hexadecimal number, the weights are 4096 256 16 1 163 162 161 160
  • 24. Hexadecimal-to-Decimal Conversion Example : Express 1A2F16 in decimal. Solution :  Start by writing the column weights:  4096 256 16 1  ( 1 A 2 F)16 = 1(4096) + 10(256) +2(16) +15(1) = 6703
  • 25. Decimal-to-Hexadecimal Conversion Repeated division of a decimal number by 16 will produce the equivalent hexadecimal number, formed by the remainders of the divisions. The first remainder produced is the least significant Digit (LSD). Each successive division by 16 yields a remainder that becomes a digit in the equivalent hexadecimal number.
  • 27. Octal Numbers Like the hexadecimal number system, the octal number system provides a convenient way to express binary numbers and codes. The octal number system is composed of eight digits, which are  0, I, 2, 3, 4, 5, 6, 7
  • 28. Octal-to-Decimal Conversion Since the octal number system has a base of eight, each successive digit position is an increasing power of eight, beginning in the right-most column with 8°. The evaluation of an octal number in terms of its decimal equivalent is accomplished by multiplying each digit by its weight and summing the products,  as illustrated here for (2374),
  • 29. Decimal-to-Octal Conversion A method of converting a decimal number to an octal number is the repeated division-by- 8 method,
  • 30. Octal-to-Binary Conversion Because each octal digit can be represented by a 3-bit binary number, it is very easy to convert from octal to binary. Each octal digit is represented by three bits as shown below. To convert an octal number to a binary number, simply replace each octal digit with the appropriate three bits.
  • 31. Binary-to-Octal Conversion Conversion of a binary number to an octal number is the reverse of the octal-to-binary conversion. The procedure is as follows:  Start with the right-most group of three bits and, moving from right to left,  convert each 3-bit group to the equivalent octal digit.  If there are not three bits available for the left-most group, add either one or two zeroes to make a complete group.  These leading zeroes do not affect the value of the binary number