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

SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
CaitlinCummins3
 

Recently uploaded (20)

An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge App
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
 
Mattingly "AI and Prompt Design: LLMs with Text Classification and Open Source"
Mattingly "AI and Prompt Design: LLMs with Text Classification and Open Source"Mattingly "AI and Prompt Design: LLMs with Text Classification and Open Source"
Mattingly "AI and Prompt Design: LLMs with Text Classification and Open Source"
 
Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"
 
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxAnalyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio App
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...
 
e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopal
 
MOOD STABLIZERS DRUGS.pptx
MOOD     STABLIZERS           DRUGS.pptxMOOD     STABLIZERS           DRUGS.pptx
MOOD STABLIZERS DRUGS.pptx
 
How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
 
Championnat de France de Tennis de table/
Championnat de France de Tennis de table/Championnat de France de Tennis de table/
Championnat de France de Tennis de table/
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategies
 
How to Manage Closest Location in Odoo 17 Inventory
How to Manage Closest Location in Odoo 17 InventoryHow to Manage Closest Location in Odoo 17 Inventory
How to Manage Closest Location in Odoo 17 Inventory
 
philosophy and it's principles based on the life
philosophy and it's principles based on the lifephilosophy and it's principles based on the life
philosophy and it's principles based on the life
 

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