SlideShare a Scribd company logo
1 of 11
An Introduction to Computer
Hardware - BKHS
Binary Numbers

1
01/08/14
Introduction
 Importance

of the Binary Number
 Use of binary numbers in computers

2
01/08/14
Agenda
 Binary

Theory
 Binary to Decimal Conversion
 Decimal to Binary Conversion
 Data Flow using Binary Numbers

3
01/08/14
Overview
 Binary

numbers are used extensively
in digital electronics
 Binary numbers are the foundation of
other numbering systems such as
Hexadecimal and Octal when used in
digital electronics.

4
01/08/14
Binary Numbers Defined
 A single

“bit” is the foundation
 Only 2 states possible
 Hi – Lo, On – Off, True – False, Open
– Closed
 8 “bits” makeup a single “byte”
 Data typically stored in “bytes”

5
01/08/14
Converting Decimal to Binary
 LSB

– least significant bit
 MSB – Most significant bit
 Divide the number by 2
 If no remainder, record a zero (0) for LSB
 If there is a remainder, record a one (1)
for LSB
 Divide the previous answer by 2
 If no remainder, record a zero in the next
bit position (to the left of the LSB)
 If there is a remainder, record a one.
 Repeat previous 3 steps until the answer
is no longer divisible by 2.

6
01/08/14
Decimal to Binary Example
Convert 5267 to binary
5267/2 = 2633
2633/2 = 1316
1316/2 = 658
658/2 = 329
329/2 = 164
164/2 = 82
82/2 = 41
41/2 = 20
20/2 = 10
10/2 = 5
5/2
=2
2/2
=1
1/2 =0

r-1
r-1
r–0
r–0
r–1
r–0
r–0
r–1
r–0
r–0
r–1
r–0
r–1

LSB = 1
next = 1
next = 0
next = 0
next = 1
next = 0
next = 0
next = 1
next = 0
next = 0
next = 1
next = 0
MSB = 1

Binary Number – 1010010010011
7
01/08/14
Converting Binary to Decimal
Convert 1101001 to decimal
Each bit position is calculated using the formula:
(value in position) x 2^(position #)
so, if bit position 2 = 1 then, applying the formula
1 x 2^2 = 4
Any bit position containing a zero is skipped
Bit position 0 is the LSB. LSB = 1, so 2^0 = 1, add it.
Bit position 1 is 0, so skip it
Bit position 2 is 0, so skip it also
Bit position 3 is 1, so 2^3 = 8, add it.
Bit position 4 is 0, so skip it
Bit position 5 is 1, so 2^5 = 32, add it.
Bit position 6 is the MSB, MSB = 1 so 2^6 = 64, add it.
1 + 8 + 32 + 64 = 105.
Decimal value = 105

8
01/08/14
Adding Binary Numbers
1010 +1111 ______
 Step one:
Column 2^0: 0+1=1.
Record the 1.
Temporary Result: 1; Carry: 0
 Step two:
Column 2^1: 1+1=10.
Record the 0, carry the 1.
Temporary Result: 01; Carry: 1
 Step three:
Column 2^2: 1+0=1 Add 1 from carry: 1+1=10.
Record the 0, carry the 1.
Temporary Result: 001; Carry: 1
 Step four:
Column 2^3: 1+1=10. Add 1 from carry: 10+1=11.
Record the 11.
Final result: 11001
9
01/08/14
Binary Multiplication
Multiplication in the binary system works the same
way as in the decimal system:
 1*1=1
 1*0=0
 0*1=0
101
* 11
-----101
1010
-----1111
10
01/08/14
Data Streams using Binary numbers

In the diagram, a start bit is sent, followed by eight data
bits, no parity bit and one stop bit, for a 10-bit character
frame. The number of data and formatting bits, and the
transmission speed, must be pre-agreed by the
communicating parties.
After the stop bit, the line may remain idle indefinitely, or
another character may immediately be started:
11
01/08/14

More Related Content

What's hot

Chap ii.BCD code,Gray code
Chap ii.BCD code,Gray codeChap ii.BCD code,Gray code
Chap ii.BCD code,Gray code
Bala Ganesh
 
Binaryconversion 090715011937-phpapp01
Binaryconversion 090715011937-phpapp01Binaryconversion 090715011937-phpapp01
Binaryconversion 090715011937-phpapp01
Abhay kadu
 
Numbersystem 130621192712-phpapp02
Numbersystem 130621192712-phpapp02Numbersystem 130621192712-phpapp02
Numbersystem 130621192712-phpapp02
muhammadsarab
 

What's hot (20)

Chapter 6
Chapter 6Chapter 6
Chapter 6
 
Computer Data Representation
Computer Data RepresentationComputer Data Representation
Computer Data Representation
 
Data representation
Data representationData representation
Data representation
 
Integers
IntegersIntegers
Integers
 
Basics of digital electronics
Basics of digital electronicsBasics of digital electronics
Basics of digital electronics
 
Binary computing
Binary computingBinary computing
Binary computing
 
Advantage of binary number system
Advantage of binary number systemAdvantage of binary number system
Advantage of binary number system
 
Number Systems Basic Concepts
Number Systems Basic ConceptsNumber Systems Basic Concepts
Number Systems Basic Concepts
 
Number Systems Basic Concepts
Number Systems Basic ConceptsNumber Systems Basic Concepts
Number Systems Basic Concepts
 
Representation of Positive Numbers
Representation of Positive NumbersRepresentation of Positive Numbers
Representation of Positive Numbers
 
Chapter#6
Chapter#6Chapter#6
Chapter#6
 
Chap ii.BCD code,Gray code
Chap ii.BCD code,Gray codeChap ii.BCD code,Gray code
Chap ii.BCD code,Gray code
 
Binaryconversion 090715011937-phpapp01
Binaryconversion 090715011937-phpapp01Binaryconversion 090715011937-phpapp01
Binaryconversion 090715011937-phpapp01
 
(6) cpp numeric representation
(6) cpp numeric representation(6) cpp numeric representation
(6) cpp numeric representation
 
Number system
Number systemNumber system
Number system
 
Numbersystem 130621192712-phpapp02
Numbersystem 130621192712-phpapp02Numbersystem 130621192712-phpapp02
Numbersystem 130621192712-phpapp02
 
SD & D Representing Positive Numbers
SD & D Representing Positive NumbersSD & D Representing Positive Numbers
SD & D Representing Positive Numbers
 
Bca 2nd sem-u-1.3 digital logic circuits, digital component
Bca 2nd sem-u-1.3 digital logic circuits, digital componentBca 2nd sem-u-1.3 digital logic circuits, digital component
Bca 2nd sem-u-1.3 digital logic circuits, digital component
 
CCS103 Bits, Bytes, Binary
CCS103 Bits, Bytes, BinaryCCS103 Bits, Bytes, Binary
CCS103 Bits, Bytes, Binary
 
B.sc cs-ii-u-1.9 digital logic circuits, digital component floting and fixed ...
B.sc cs-ii-u-1.9 digital logic circuits, digital component floting and fixed ...B.sc cs-ii-u-1.9 digital logic circuits, digital component floting and fixed ...
B.sc cs-ii-u-1.9 digital logic circuits, digital component floting and fixed ...
 

Similar to Binary numbers

Alu1
Alu1Alu1

Similar to Binary numbers (20)

Digital electronics
Digital electronicsDigital electronics
Digital electronics
 
DLD_PPT_0.pptx
DLD_PPT_0.pptxDLD_PPT_0.pptx
DLD_PPT_0.pptx
 
Representation of Integers
Representation of IntegersRepresentation of Integers
Representation of Integers
 
Data representation in computers
Data representation in computersData representation in computers
Data representation in computers
 
dtei-180910104911-converted.pptx
dtei-180910104911-converted.pptxdtei-180910104911-converted.pptx
dtei-180910104911-converted.pptx
 
Introduction to binary
Introduction to binaryIntroduction to binary
Introduction to binary
 
Cse 112 number system-[id_142-15-3472]
Cse 112 number system-[id_142-15-3472]Cse 112 number system-[id_142-15-3472]
Cse 112 number system-[id_142-15-3472]
 
09 binary number systems
09   binary number systems09   binary number systems
09 binary number systems
 
COMPUTER ORGANIZATION NOTES Unit 2
COMPUTER ORGANIZATION NOTES  Unit 2COMPUTER ORGANIZATION NOTES  Unit 2
COMPUTER ORGANIZATION NOTES Unit 2
 
Digital Logic
Digital LogicDigital Logic
Digital Logic
 
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
 
IARE_DLD_PPT_0.pdf
IARE_DLD_PPT_0.pdfIARE_DLD_PPT_0.pdf
IARE_DLD_PPT_0.pdf
 
data representation
 data representation data representation
data representation
 
Digital Electronics Codes.pdf
Digital Electronics Codes.pdfDigital Electronics Codes.pdf
Digital Electronics Codes.pdf
 
Alu1
Alu1Alu1
Alu1
 
Binary numbers
Binary numbersBinary numbers
Binary numbers
 
Data Representation
Data RepresentationData Representation
Data Representation
 
lect1.ppt
lect1.pptlect1.ppt
lect1.ppt
 
Dee 2034 chapter 1 number and code system (Baia)
Dee 2034 chapter 1 number and code system (Baia)Dee 2034 chapter 1 number and code system (Baia)
Dee 2034 chapter 1 number and code system (Baia)
 
Introduction of number system
Introduction of number systemIntroduction of number system
Introduction of number system
 

Recently uploaded

Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
MateoGardella
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 

Recently uploaded (20)

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 

Binary numbers

  • 1. An Introduction to Computer Hardware - BKHS Binary Numbers 1 01/08/14
  • 2. Introduction  Importance of the Binary Number  Use of binary numbers in computers 2 01/08/14
  • 3. Agenda  Binary Theory  Binary to Decimal Conversion  Decimal to Binary Conversion  Data Flow using Binary Numbers 3 01/08/14
  • 4. Overview  Binary numbers are used extensively in digital electronics  Binary numbers are the foundation of other numbering systems such as Hexadecimal and Octal when used in digital electronics. 4 01/08/14
  • 5. Binary Numbers Defined  A single “bit” is the foundation  Only 2 states possible  Hi – Lo, On – Off, True – False, Open – Closed  8 “bits” makeup a single “byte”  Data typically stored in “bytes” 5 01/08/14
  • 6. Converting Decimal to Binary  LSB – least significant bit  MSB – Most significant bit  Divide the number by 2  If no remainder, record a zero (0) for LSB  If there is a remainder, record a one (1) for LSB  Divide the previous answer by 2  If no remainder, record a zero in the next bit position (to the left of the LSB)  If there is a remainder, record a one.  Repeat previous 3 steps until the answer is no longer divisible by 2. 6 01/08/14
  • 7. Decimal to Binary Example Convert 5267 to binary 5267/2 = 2633 2633/2 = 1316 1316/2 = 658 658/2 = 329 329/2 = 164 164/2 = 82 82/2 = 41 41/2 = 20 20/2 = 10 10/2 = 5 5/2 =2 2/2 =1 1/2 =0 r-1 r-1 r–0 r–0 r–1 r–0 r–0 r–1 r–0 r–0 r–1 r–0 r–1 LSB = 1 next = 1 next = 0 next = 0 next = 1 next = 0 next = 0 next = 1 next = 0 next = 0 next = 1 next = 0 MSB = 1 Binary Number – 1010010010011 7 01/08/14
  • 8. Converting Binary to Decimal Convert 1101001 to decimal Each bit position is calculated using the formula: (value in position) x 2^(position #) so, if bit position 2 = 1 then, applying the formula 1 x 2^2 = 4 Any bit position containing a zero is skipped Bit position 0 is the LSB. LSB = 1, so 2^0 = 1, add it. Bit position 1 is 0, so skip it Bit position 2 is 0, so skip it also Bit position 3 is 1, so 2^3 = 8, add it. Bit position 4 is 0, so skip it Bit position 5 is 1, so 2^5 = 32, add it. Bit position 6 is the MSB, MSB = 1 so 2^6 = 64, add it. 1 + 8 + 32 + 64 = 105. Decimal value = 105 8 01/08/14
  • 9. Adding Binary Numbers 1010 +1111 ______  Step one: Column 2^0: 0+1=1. Record the 1. Temporary Result: 1; Carry: 0  Step two: Column 2^1: 1+1=10. Record the 0, carry the 1. Temporary Result: 01; Carry: 1  Step three: Column 2^2: 1+0=1 Add 1 from carry: 1+1=10. Record the 0, carry the 1. Temporary Result: 001; Carry: 1  Step four: Column 2^3: 1+1=10. Add 1 from carry: 10+1=11. Record the 11. Final result: 11001 9 01/08/14
  • 10. Binary Multiplication Multiplication in the binary system works the same way as in the decimal system:  1*1=1  1*0=0  0*1=0 101 * 11 -----101 1010 -----1111 10 01/08/14
  • 11. Data Streams using Binary numbers In the diagram, a start bit is sent, followed by eight data bits, no parity bit and one stop bit, for a 10-bit character frame. The number of data and formatting bits, and the transmission speed, must be pre-agreed by the communicating parties. After the stop bit, the line may remain idle indefinitely, or another character may immediately be started: 11 01/08/14