SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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 ...
 

Semelhante a Binary numbers

Alu1
Alu1Alu1

Semelhante a 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
 

Último

Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Último (20)

Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
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.
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.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