SlideShare a Scribd company logo
Binary Numbers
Binary
Octal
Hexadecimal
Binary Numbers
• COUNTING SYSTEMS UNLIMITED . . . Since you have been using the
10 different digits 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 all your life, you may
wonder how it is possible to count and do arithmetic without using all 10.
Actually, there is no advantage in using 10 counting digits rather than, say,
8, 12, or 16. The 10-digit system (called the decimal system, since the word
"decimal" means "based on 10") probably came into universal use because
man first started to count by using his fingers, and there happen to be 10 of
them.
• To see how to count by using other than 10 digits, notice how we count in
the ordinary decimal system. We represent a number higher than 9, the
highest digit, by a combination of two or more digits. The number next
after 9 is 10, and then 11, etc. After we reach 99, the highest number that
can be written with two digits, we start using three digits. The number next
after 99 is 100, and then comes 101, etc.
• Now let's try counting in the octal system. "Octal" means "based on eight";
that is, we use only the eight digits 0, 1, 2, 3, 4, 5, 6, and 7. The digits 8 and
9 are not used. So now what do we do after we have counted to 7? Since
we have used up all the symbols we are permitted to use, we write 10 as the
next number and then comes 11 and so on up to 17. After 17 comes 20.
Decimal Octal
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 10
9 11
10 12
11 13
12 14
13 15
14 16
15 17
16 20
17 21
18 22
19 23
Binary Numbers
• THE NATURAL BINARY SYSTEM ... Now that you have seen how it
is possible to count in numbering systems other than the
decimal system, we shall consider the system of most interest in
electronics. That is the binary system, which uses only the two
digits 0 and 1.
• We can count in the binary system by using the plan explained in
the preceding topic for counting in other systems. The first
number in counting is 1, of course. Since we can use no digit
higher than 1, we must go to two digits and write 10 for the
second binary number. Then comes 11, and after that we must
go to three digits and write 100.
• Binary numbers as written in the table form the natural binary
numbering system. It is called natural because it follows the
general counting method used in the decimal, octal, and other
numbering systems. As you will see later in the lesson, the
natural binary system is only one of a number of methods for
representing numbers by using only the digits 0 and 1.
Decimal Octal Binary
0 0 0000
1 1 0001
2 2 0010
3 3 0011
4 4 0100
5 5 0101
6 6 0110
7 7 0111
8 10 1000
9 11 1001
10 12 1010
11 13 1011
12 14 1100
13 15 1101
14 16 1110
15 17 1111
16 20 10000
17 21 10001
18 22 10010
19 23 10011
Binary Numbers
CONVERSION BETWEEN OCTAL AND BINARY SYSTEMS ... As you have no
doubt observed by this time, writing out and reading numbers in natural binary form is
quite a nuisance because of the large number of digits involved. Since it is easy to
convert natural binary numbers into octal numbers, it is practical to write or machine
print out natural binary numbers as octal numbers for ease in handling. A couple of
examples will show you how the conversions are made.
• EXAMPLE ... Convert binary number 1011010 to the octal equivalent.
• SOLUTION . . . The first step is to rewrite the number with the digits
grouped in threes:
001 011 010
• Note that two zeros were placed in front of the first digit 1 in order to make
every group complete.
• Next, write the decimal equivalent over each group of three:
1 3 2
001 011 010
• The octal equivalent of binary 1011010 is 132.
Binary Numbers
• The hexadecimal system, or Hex, uses base 16, therefore
there are 16 possible digit symbols. The hexadecimal
system groups binary number by 4’s and from 0 to 9 it is
the same as a decimal number equivalent in binary form.
This means 0000 is 0, 0001 is 1, 0010 is 2 and so on to 1001
being 9, but then from 1010 to 1111 of binary the
hexadecimal uses letters from A to F and then when it
reaches the value of 16 it becomes 10 because the two
groups of four binary numbers are 0001 0000. When taken
as a binary number it is 0001 0000 while the decimal
number is 16 and the hexadecimal number is 10. Therefore
an 8 bit binary number (byte) is divided into two groups of
four bits each. The chart in the next slide shows all of this.
Decimal Octal Binary Hex
0 0 0000 0
1 1 0001 1
2 2 0010 2
3 3 0011 3
4 4 0100 4
5 5 0101 5
6 6 0110 6
7 7 0111 7
8 10 1000 8
9 11 1001 9
10 12 1010 A
11 13 1011 B
12 14 1100 C
13 15 1101 D
14 16 1110 E
15 17 1111 F
16 20 0001 0000 10
17 21 0001 0001 11
18 22 0001 0010 12
19 23 0001 0011 13
Binary Numbers
CONVERSION BETWEEN HEXADECIMAL AND BINARY SYSTEMS ... As you
have no doubt observed by this time, writing out and reading numbers in natural binary
form is quite a nuisance because of the large number of digits involved. Since it is easy
to convert natural binary numbers into hexadecimal numbers, it is practical to write or
machine print out natural binary numbers as hexadecimal numbers for ease in handling.
A couple of examples will show you how the conversions are made.
• EXAMPLE ... Convert binary number 1011010 to the hexadecimal equivalent.
• SOLUTION . . . The first step is to rewrite the number with the digits grouped in
fours:
0101 1010
• Note the zero were placed in front of the first digit 1 in order to make the two
groups complete.
• Next, write the decimal equivalent over each group:
5 A
0101 1010
• The hexadecimal equivalent of binary 1011010 is 5A.
• Conceptually similar to decimal addition
• Example: Add the binary numbers 1010 and 11
Binary Addition
1 0 1 0
+ 1 1
(carry)
1
1011
Example:
Subtract binary number 101 from 1011
Binary Subtraction
1 0 1 1
- 1 0 1
(borrow)
0110
10
• 2s complement representation - widely
used in microprocessors.
• Represents sign and magnitude
2s Complement Notation
Decimal: +7 +4 +1 0 -1 -4 -7
2s Complement: 0111 0100 0001 0000 1111 1100 1001
MSB LSB
Sign bit (0 = + ; 1 = -)
• Converting positive numbers to 2s complement:
• Same as converting to binary
• Converting negative numbers to 2s complement:
2s Complement - Conversions
- 4 (decimal)
0 1 0 0
1 0 1 1
- 4 = 1 1 0 0 (2s Complement)
Decimal to 2s
Complement
Convert decimal
to binary
1s
complement
Add 1
2s Complement to
Binary
1 1 0 0 (2s C)
0 0 1 1
0 1 0 0 (Binary)
1s
complement
Add 1
2s complement notation makes it possible to
add and subtract signed numbers
Adding/Subtracting in 2s Complement
(- 1)
+ (- 2)
(- 3)
1 1 1 1
+ 1 1 1 0
10111
Discard
(+1)
+ (- 3)
(- 2)
0 0 0 1
+ 1 1 0 1
0111
(Decimal) 2s Complement
2s complement
2s complement
Practical Suggestion for Binary Math
• Use a scientific calculator.
• Most scientific calculators have
DEC, BIN, OCT, and HEX modes
and can either convert between codes
or perform arithmetic in different
number systems.
• Most scientific calculators also
have other functions that are
valuable in digital electronics
such as AND, OR, NOT, XOR,
and XNOR logic functions.

More Related Content

What's hot

Number System Conversion
Number System ConversionNumber System Conversion
Number System Conversion
Faraz Ahmed
 
Number system
Number systemNumber system
Number system
University of Potsdam
 
Number systems
Number systemsNumber systems
Number systems
pyingkodi maran
 
Number Systems and Binary Aritmetics
Number Systems and Binary AritmeticsNumber Systems and Binary Aritmetics
Number Systems and Binary Aritmetics
Delowar Hossain
 
Binary Arithmetic
Binary ArithmeticBinary Arithmetic
Binary Arithmeticgavhays
 
Number system utm notes
Number system utm notesNumber system utm notes
Number system utm notes
Kurenai Ryu
 
The binary number system
The binary number systemThe binary number system
The binary number system
Showmmo
 
NUMBER SYSTEM
NUMBER SYSTEMNUMBER SYSTEM
Introduction to the Binary Number System
Introduction to the Binary Number SystemIntroduction to the Binary Number System
Introduction to the Binary Number SystemJames Hamilton
 
Number Systems
Number SystemsNumber Systems
Number Systems
Jubayer Alam Shoikat
 
De numbers systems vk ppt
De numbers systems vk  pptDe numbers systems vk  ppt
De numbers systems vk ppt
VinodKataria5
 
Binary number ppt
Binary number pptBinary number ppt
Binary number ppt
Ankit Gupta
 
Binary octal
Binary octalBinary octal
Binary octaldrdipo4
 
Decimal to binary number
Decimal to binary numberDecimal to binary number
Decimal to binary numberguestd8696a
 
Chapter 1: Binary System
 Chapter 1: Binary System Chapter 1: Binary System
Chapter 1: Binary System
Er. Nawaraj Bhandari
 
Chapter 2.1 introduction to number system
Chapter 2.1 introduction to number systemChapter 2.1 introduction to number system
Chapter 2.1 introduction to number system
ISMT College
 
More on number system
More on number systemMore on number system
More on number system
samina khan
 
Number system
Number systemNumber system
Number system
Palash Sachan
 

What's hot (20)

Number System Conversion
Number System ConversionNumber System Conversion
Number System Conversion
 
Number system
Number system Number system
Number system
 
Number system
Number systemNumber system
Number system
 
Number systems
Number systemsNumber systems
Number systems
 
Number Systems and Binary Aritmetics
Number Systems and Binary AritmeticsNumber Systems and Binary Aritmetics
Number Systems and Binary Aritmetics
 
Binary Arithmetic
Binary ArithmeticBinary Arithmetic
Binary Arithmetic
 
Number system utm notes
Number system utm notesNumber system utm notes
Number system utm notes
 
The binary number system
The binary number systemThe binary number system
The binary number system
 
NUMBER SYSTEM
NUMBER SYSTEMNUMBER SYSTEM
NUMBER SYSTEM
 
Introduction to the Binary Number System
Introduction to the Binary Number SystemIntroduction to the Binary Number System
Introduction to the Binary Number System
 
Number Systems
Number SystemsNumber Systems
Number Systems
 
De numbers systems vk ppt
De numbers systems vk  pptDe numbers systems vk  ppt
De numbers systems vk ppt
 
Binary number ppt
Binary number pptBinary number ppt
Binary number ppt
 
Binary octal
Binary octalBinary octal
Binary octal
 
Decimal to binary number
Decimal to binary numberDecimal to binary number
Decimal to binary number
 
Chapter 1: Binary System
 Chapter 1: Binary System Chapter 1: Binary System
Chapter 1: Binary System
 
Chapter 2.1 introduction to number system
Chapter 2.1 introduction to number systemChapter 2.1 introduction to number system
Chapter 2.1 introduction to number system
 
More on number system
More on number systemMore on number system
More on number system
 
Binary arithmetic
Binary arithmeticBinary arithmetic
Binary arithmetic
 
Number system
Number systemNumber system
Number system
 

Viewers also liked

Alu1
Alu1Alu1
Booth’s algorithm.(a014& a015)
Booth’s algorithm.(a014& a015)Booth’s algorithm.(a014& a015)
Booth’s algorithm.(a014& a015)Piyush Rochwani
 
Biometrics based key generation
Biometrics based key generationBiometrics based key generation
Biometrics based key generation
Piyush Rochwani
 
Arithmetic circuits
Arithmetic circuitsArithmetic circuits
Arithmetic circuits
Sanjay Saluth
 
Unit 3
Unit 3Unit 3
Unit 2
Unit 2Unit 2
프로그래머가 알아야 하는 2진수 기반의 컴퓨터 동작 원리
프로그래머가 알아야 하는 2진수 기반의 컴퓨터 동작 원리프로그래머가 알아야 하는 2진수 기반의 컴퓨터 동작 원리
프로그래머가 알아야 하는 2진수 기반의 컴퓨터 동작 원리
중선 곽
 

Viewers also liked (9)

Cisc(a022& a023)
Cisc(a022& a023)Cisc(a022& a023)
Cisc(a022& a023)
 
Alu1
Alu1Alu1
Alu1
 
Booth’s algorithm.(a014& a015)
Booth’s algorithm.(a014& a015)Booth’s algorithm.(a014& a015)
Booth’s algorithm.(a014& a015)
 
Biometrics based key generation
Biometrics based key generationBiometrics based key generation
Biometrics based key generation
 
Arithmetic circuits
Arithmetic circuitsArithmetic circuits
Arithmetic circuits
 
Unit 3
Unit 3Unit 3
Unit 3
 
Unit 2
Unit 2Unit 2
Unit 2
 
프로그래머가 알아야 하는 2진수 기반의 컴퓨터 동작 원리
프로그래머가 알아야 하는 2진수 기반의 컴퓨터 동작 원리프로그래머가 알아야 하는 2진수 기반의 컴퓨터 동작 원리
프로그래머가 알아야 하는 2진수 기반의 컴퓨터 동작 원리
 
06 floating point
06 floating point06 floating point
06 floating point
 

Similar to Binary numbers-7-12-2011

binary-numbers-system.doc.docx
binary-numbers-system.doc.docxbinary-numbers-system.doc.docx
binary-numbers-system.doc.docx
ArvindShukla81
 
Number bases
Number basesNumber bases
Number System.pptx
Number System.pptxNumber System.pptx
Number System.pptx
Lovely Professional University
 
As Level Computer Science Book -1
As Level Computer Science  Book -1As Level Computer Science  Book -1
As Level Computer Science Book -1
DIGDARSHAN KUNWAR
 
Number Systems
Number SystemsNumber Systems
Number Systems
Infinity Tech Solutions
 
Ch 4
Ch 4Ch 4
Ch 4
nesaryyyy
 
Cit 1101 lec 02
Cit 1101 lec 02Cit 1101 lec 02
Cit 1101 lec 02
sohag sikder
 
Binary, Decimal and Hexadecimal
Binary, Decimal and HexadecimalBinary, Decimal and Hexadecimal
Binary, Decimal and Hexadecimal
UthraSowrirajan1
 
Number-Systems presentation of the mathematics
Number-Systems presentation of the mathematicsNumber-Systems presentation of the mathematics
Number-Systems presentation of the mathematics
shivas379526
 
Representation Of Numbers and Characters
Representation Of Numbers and CharactersRepresentation Of Numbers and Characters
Representation Of Numbers and Characters
Shaikh Kamrul Islam (Konok kamrul)
 
Week 4-Number Systems.pptx
Week 4-Number Systems.pptxWeek 4-Number Systems.pptx
Week 4-Number Systems.pptx
HamnaKhalid25
 
uyuyuy.pdf
uyuyuy.pdfuyuyuy.pdf
uyuyuy.pdf
MariaJoseph591921
 
Arithmetic.ppt
Arithmetic.pptArithmetic.ppt
Arithmetic.ppt
MarlonMagtibay2
 
Number system
Number systemNumber system
Number system
Sajib
 
Number System and Conversions.pptx
Number System and Conversions.pptxNumber System and Conversions.pptx
Number System and Conversions.pptx
khalidkk6
 
Data representation in computers
Data representation in computersData representation in computers
Data representation in computers
Prof. Dr. K. Adisesha
 
ComEd101 - Chapter 2 Lesson 2.pptx
ComEd101 - Chapter 2 Lesson 2.pptxComEd101 - Chapter 2 Lesson 2.pptx
ComEd101 - Chapter 2 Lesson 2.pptx
JohnPaulNavarro7
 
Number system
Number systemNumber system
Number system
Darpan Chelani
 
DATA REPRESENTATION.pptx
DATA REPRESENTATION.pptxDATA REPRESENTATION.pptx
DATA REPRESENTATION.pptx
MamataAnilgod
 
02 number systems
02 number systems02 number systems
02 number systems
john01383
 

Similar to Binary numbers-7-12-2011 (20)

binary-numbers-system.doc.docx
binary-numbers-system.doc.docxbinary-numbers-system.doc.docx
binary-numbers-system.doc.docx
 
Number bases
Number basesNumber bases
Number bases
 
Number System.pptx
Number System.pptxNumber System.pptx
Number System.pptx
 
As Level Computer Science Book -1
As Level Computer Science  Book -1As Level Computer Science  Book -1
As Level Computer Science Book -1
 
Number Systems
Number SystemsNumber Systems
Number Systems
 
Ch 4
Ch 4Ch 4
Ch 4
 
Cit 1101 lec 02
Cit 1101 lec 02Cit 1101 lec 02
Cit 1101 lec 02
 
Binary, Decimal and Hexadecimal
Binary, Decimal and HexadecimalBinary, Decimal and Hexadecimal
Binary, Decimal and Hexadecimal
 
Number-Systems presentation of the mathematics
Number-Systems presentation of the mathematicsNumber-Systems presentation of the mathematics
Number-Systems presentation of the mathematics
 
Representation Of Numbers and Characters
Representation Of Numbers and CharactersRepresentation Of Numbers and Characters
Representation Of Numbers and Characters
 
Week 4-Number Systems.pptx
Week 4-Number Systems.pptxWeek 4-Number Systems.pptx
Week 4-Number Systems.pptx
 
uyuyuy.pdf
uyuyuy.pdfuyuyuy.pdf
uyuyuy.pdf
 
Arithmetic.ppt
Arithmetic.pptArithmetic.ppt
Arithmetic.ppt
 
Number system
Number systemNumber system
Number system
 
Number System and Conversions.pptx
Number System and Conversions.pptxNumber System and Conversions.pptx
Number System and Conversions.pptx
 
Data representation in computers
Data representation in computersData representation in computers
Data representation in computers
 
ComEd101 - Chapter 2 Lesson 2.pptx
ComEd101 - Chapter 2 Lesson 2.pptxComEd101 - Chapter 2 Lesson 2.pptx
ComEd101 - Chapter 2 Lesson 2.pptx
 
Number system
Number systemNumber system
Number system
 
DATA REPRESENTATION.pptx
DATA REPRESENTATION.pptxDATA REPRESENTATION.pptx
DATA REPRESENTATION.pptx
 
02 number systems
02 number systems02 number systems
02 number systems
 

More from Januário Esteves

O essencial sobre bernardim ribeiro
O essencial sobre bernardim ribeiroO essencial sobre bernardim ribeiro
O essencial sobre bernardim ribeiro
Januário Esteves
 
I1 a07alcroeweylferna
I1 a07alcroeweylfernaI1 a07alcroeweylferna
I1 a07alcroeweylferna
Januário Esteves
 
As quadrasdopovo n05
As quadrasdopovo n05As quadrasdopovo n05
As quadrasdopovo n05
Januário Esteves
 
Presença e ausenciua do divino
Presença e ausenciua do divinoPresença e ausenciua do divino
Presença e ausenciua do divino
Januário Esteves
 
1223290786 u1mkk3no2zu36nc6
1223290786 u1mkk3no2zu36nc61223290786 u1mkk3no2zu36nc6
1223290786 u1mkk3no2zu36nc6
Januário Esteves
 
433598
433598433598
248255 334309-1-pb
248255 334309-1-pb248255 334309-1-pb
248255 334309-1-pb
Januário Esteves
 
10430
1043010430
7756
77567756
6177
61776177
I1 a07alcroeweylferna
I1 a07alcroeweylfernaI1 a07alcroeweylferna
I1 a07alcroeweylferna
Januário Esteves
 
Na esteira da liberdade
Na esteira da liberdadeNa esteira da liberdade
Na esteira da liberdade
Januário Esteves
 
Urbe 4768
Urbe 4768Urbe 4768
Tzara d1
Tzara d1Tzara d1
Binary overview
Binary overviewBinary overview
Binary overview
Januário Esteves
 
Appendix
AppendixAppendix
Kpasaesivolii
KpasaesivoliiKpasaesivolii
Kpasaesivolii
Januário Esteves
 
V30n4a07
V30n4a07V30n4a07
Vol iii n1_213-228
Vol iii n1_213-228Vol iii n1_213-228
Vol iii n1_213-228
Januário Esteves
 
Rfc43 artigo8
Rfc43 artigo8Rfc43 artigo8
Rfc43 artigo8
Januário Esteves
 

More from Januário Esteves (20)

O essencial sobre bernardim ribeiro
O essencial sobre bernardim ribeiroO essencial sobre bernardim ribeiro
O essencial sobre bernardim ribeiro
 
I1 a07alcroeweylferna
I1 a07alcroeweylfernaI1 a07alcroeweylferna
I1 a07alcroeweylferna
 
As quadrasdopovo n05
As quadrasdopovo n05As quadrasdopovo n05
As quadrasdopovo n05
 
Presença e ausenciua do divino
Presença e ausenciua do divinoPresença e ausenciua do divino
Presença e ausenciua do divino
 
1223290786 u1mkk3no2zu36nc6
1223290786 u1mkk3no2zu36nc61223290786 u1mkk3no2zu36nc6
1223290786 u1mkk3no2zu36nc6
 
433598
433598433598
433598
 
248255 334309-1-pb
248255 334309-1-pb248255 334309-1-pb
248255 334309-1-pb
 
10430
1043010430
10430
 
7756
77567756
7756
 
6177
61776177
6177
 
I1 a07alcroeweylferna
I1 a07alcroeweylfernaI1 a07alcroeweylferna
I1 a07alcroeweylferna
 
Na esteira da liberdade
Na esteira da liberdadeNa esteira da liberdade
Na esteira da liberdade
 
Urbe 4768
Urbe 4768Urbe 4768
Urbe 4768
 
Tzara d1
Tzara d1Tzara d1
Tzara d1
 
Binary overview
Binary overviewBinary overview
Binary overview
 
Appendix
AppendixAppendix
Appendix
 
Kpasaesivolii
KpasaesivoliiKpasaesivolii
Kpasaesivolii
 
V30n4a07
V30n4a07V30n4a07
V30n4a07
 
Vol iii n1_213-228
Vol iii n1_213-228Vol iii n1_213-228
Vol iii n1_213-228
 
Rfc43 artigo8
Rfc43 artigo8Rfc43 artigo8
Rfc43 artigo8
 

Recently uploaded

DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
FluxPrime1
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
BrazilAccount1
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
AafreenAbuthahir2
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 

Recently uploaded (20)

DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 

Binary numbers-7-12-2011

  • 2. Binary Numbers • COUNTING SYSTEMS UNLIMITED . . . Since you have been using the 10 different digits 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 all your life, you may wonder how it is possible to count and do arithmetic without using all 10. Actually, there is no advantage in using 10 counting digits rather than, say, 8, 12, or 16. The 10-digit system (called the decimal system, since the word "decimal" means "based on 10") probably came into universal use because man first started to count by using his fingers, and there happen to be 10 of them. • To see how to count by using other than 10 digits, notice how we count in the ordinary decimal system. We represent a number higher than 9, the highest digit, by a combination of two or more digits. The number next after 9 is 10, and then 11, etc. After we reach 99, the highest number that can be written with two digits, we start using three digits. The number next after 99 is 100, and then comes 101, etc. • Now let's try counting in the octal system. "Octal" means "based on eight"; that is, we use only the eight digits 0, 1, 2, 3, 4, 5, 6, and 7. The digits 8 and 9 are not used. So now what do we do after we have counted to 7? Since we have used up all the symbols we are permitted to use, we write 10 as the next number and then comes 11 and so on up to 17. After 17 comes 20.
  • 3. Decimal Octal 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 20 17 21 18 22 19 23
  • 4. Binary Numbers • THE NATURAL BINARY SYSTEM ... Now that you have seen how it is possible to count in numbering systems other than the decimal system, we shall consider the system of most interest in electronics. That is the binary system, which uses only the two digits 0 and 1. • We can count in the binary system by using the plan explained in the preceding topic for counting in other systems. The first number in counting is 1, of course. Since we can use no digit higher than 1, we must go to two digits and write 10 for the second binary number. Then comes 11, and after that we must go to three digits and write 100. • Binary numbers as written in the table form the natural binary numbering system. It is called natural because it follows the general counting method used in the decimal, octal, and other numbering systems. As you will see later in the lesson, the natural binary system is only one of a number of methods for representing numbers by using only the digits 0 and 1.
  • 5. Decimal Octal Binary 0 0 0000 1 1 0001 2 2 0010 3 3 0011 4 4 0100 5 5 0101 6 6 0110 7 7 0111 8 10 1000 9 11 1001 10 12 1010 11 13 1011 12 14 1100 13 15 1101 14 16 1110 15 17 1111 16 20 10000 17 21 10001 18 22 10010 19 23 10011
  • 6. Binary Numbers CONVERSION BETWEEN OCTAL AND BINARY SYSTEMS ... As you have no doubt observed by this time, writing out and reading numbers in natural binary form is quite a nuisance because of the large number of digits involved. Since it is easy to convert natural binary numbers into octal numbers, it is practical to write or machine print out natural binary numbers as octal numbers for ease in handling. A couple of examples will show you how the conversions are made. • EXAMPLE ... Convert binary number 1011010 to the octal equivalent. • SOLUTION . . . The first step is to rewrite the number with the digits grouped in threes: 001 011 010 • Note that two zeros were placed in front of the first digit 1 in order to make every group complete. • Next, write the decimal equivalent over each group of three: 1 3 2 001 011 010 • The octal equivalent of binary 1011010 is 132.
  • 7. Binary Numbers • The hexadecimal system, or Hex, uses base 16, therefore there are 16 possible digit symbols. The hexadecimal system groups binary number by 4’s and from 0 to 9 it is the same as a decimal number equivalent in binary form. This means 0000 is 0, 0001 is 1, 0010 is 2 and so on to 1001 being 9, but then from 1010 to 1111 of binary the hexadecimal uses letters from A to F and then when it reaches the value of 16 it becomes 10 because the two groups of four binary numbers are 0001 0000. When taken as a binary number it is 0001 0000 while the decimal number is 16 and the hexadecimal number is 10. Therefore an 8 bit binary number (byte) is divided into two groups of four bits each. The chart in the next slide shows all of this.
  • 8. Decimal Octal Binary Hex 0 0 0000 0 1 1 0001 1 2 2 0010 2 3 3 0011 3 4 4 0100 4 5 5 0101 5 6 6 0110 6 7 7 0111 7 8 10 1000 8 9 11 1001 9 10 12 1010 A 11 13 1011 B 12 14 1100 C 13 15 1101 D 14 16 1110 E 15 17 1111 F 16 20 0001 0000 10 17 21 0001 0001 11 18 22 0001 0010 12 19 23 0001 0011 13
  • 9. Binary Numbers CONVERSION BETWEEN HEXADECIMAL AND BINARY SYSTEMS ... As you have no doubt observed by this time, writing out and reading numbers in natural binary form is quite a nuisance because of the large number of digits involved. Since it is easy to convert natural binary numbers into hexadecimal numbers, it is practical to write or machine print out natural binary numbers as hexadecimal numbers for ease in handling. A couple of examples will show you how the conversions are made. • EXAMPLE ... Convert binary number 1011010 to the hexadecimal equivalent. • SOLUTION . . . The first step is to rewrite the number with the digits grouped in fours: 0101 1010 • Note the zero were placed in front of the first digit 1 in order to make the two groups complete. • Next, write the decimal equivalent over each group: 5 A 0101 1010 • The hexadecimal equivalent of binary 1011010 is 5A.
  • 10. • Conceptually similar to decimal addition • Example: Add the binary numbers 1010 and 11 Binary Addition 1 0 1 0 + 1 1 (carry) 1 1011
  • 11. Example: Subtract binary number 101 from 1011 Binary Subtraction 1 0 1 1 - 1 0 1 (borrow) 0110 10
  • 12. • 2s complement representation - widely used in microprocessors. • Represents sign and magnitude 2s Complement Notation Decimal: +7 +4 +1 0 -1 -4 -7 2s Complement: 0111 0100 0001 0000 1111 1100 1001 MSB LSB Sign bit (0 = + ; 1 = -)
  • 13. • Converting positive numbers to 2s complement: • Same as converting to binary • Converting negative numbers to 2s complement: 2s Complement - Conversions - 4 (decimal) 0 1 0 0 1 0 1 1 - 4 = 1 1 0 0 (2s Complement) Decimal to 2s Complement Convert decimal to binary 1s complement Add 1 2s Complement to Binary 1 1 0 0 (2s C) 0 0 1 1 0 1 0 0 (Binary) 1s complement Add 1
  • 14. 2s complement notation makes it possible to add and subtract signed numbers Adding/Subtracting in 2s Complement (- 1) + (- 2) (- 3) 1 1 1 1 + 1 1 1 0 10111 Discard (+1) + (- 3) (- 2) 0 0 0 1 + 1 1 0 1 0111 (Decimal) 2s Complement 2s complement 2s complement
  • 15. Practical Suggestion for Binary Math • Use a scientific calculator. • Most scientific calculators have DEC, BIN, OCT, and HEX modes and can either convert between codes or perform arithmetic in different number systems. • Most scientific calculators also have other functions that are valuable in digital electronics such as AND, OR, NOT, XOR, and XNOR logic functions.